Adding and IF to my PHP
Permalink
On my C5 site I have a line of code which pulls the date which a page was created and returns how long ago it was create. This all works great whoever I need to change this so when it becomes e.g. 20 minuets and old a custom message is displayed.
This is my code currently:
How can I modify this?
This is my code currently:
$time = strtotime($LogDateTime); $LastReported = humanTiming($time); function humanTiming ($time) { $time = time() - $time; $time = ($time<1)? 1 : $time; $tokens = array ( 31536000 => 'year', 2592000 => 'month', 604800 => 'week', 86400 => 'day', 3600 => 'hour', 60 => 'minute', 1 => 'second' ); foreach ($tokens as $unit => $text) {
Viewing 15 lines of 20 lines. View entire code block.
How can I modify this?
http://stackoverflow.com/a/18602474...
https://i.imgur.com/wOsEq7N.png...