[Edit] date in hours, days, months format
example of usageecho timeBetween(1273222838,time()); function timeBetween($start,$end){ $time = $end - $start; if($time <= 60){ return 'one monent ago'; } if(60 < $time && $time <= 3600){ return round($time/60,0).' minutes'; } if(3600 < $time && $time <= 86400){ return round($time/3600,0).' hours'; } if(86400 < $time && $time <= 604800){ return round($time/86400,0).' days'; } if(604800 < $time && $time <= 2592000){ return round($time/604800,0).' weeks'; } if(2592000 < $time && $time <= 29030400){ return round($time/2592000,0).' months'; } if($time > 29030400){ return date('M d y at h:i A',$start); } } |
This Page is Under Construction! - If You Want To Help Please Send your CV - Advanced Web Core (BETA)
© Advanced Web Core. All rights reserved