Published in: PHP
URL: http://snippets.dzone.com/posts/show/4674
Hace Script / Ago Script if we call with a timestamp of a month ago, he print "Hace 1 mes". If you want this in english should traduction. Sorry my english
http://snippets.dzone.com/posts/show/4674
function hace($timestamp) { if($diferencia > 0) { for($j = 0; $diferencia >= $longitud[$j]; $j++) $diferencia /= $longitud[$j]; if($diferencia != 1) { if($periodo[$j] == "mes") $periodo[$j].= "es"; else $periodo[$j].= "s"; } return "Hace <b>".$diferencia."</b> ".$periodo[$j]; } }
You need to login to post a comment.
