Event timeing codes

function eventTiming($time){ $time = time() - $time; $tokens = array (31536000 => 'year',2592000 => 'month',604800 => 'week',86400 => 'day',3600 => 'hour',60 => 'minute',1 => 'second'); foreach ($tokens as $unit => $text) { if ($time < $unit) continue; $numberOfUnits = floor($time / $unit); return $numberOfUnits.' '.$text.(($numberOfUnits>1)?'s':'');}}

Popular posts from this blog

How to open cPanel using WHM access.

Cant use dump() function in twig files or how to enable debug in opencart twig or print_r alternate use dump() in opencart 3.0