note 54545 deleted from function.posix-times by betz

From: Date: Fri, 08 Jul 2005 08:05:37 +0000
Subject: note 54545 deleted from function.posix-times by betz
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-91646@lists.php.net to get a copy of this message
Note Submitter: -= Razor =- Reason: useless ---- I use this function because, if i put the bloody { if (!$times = posix_times()) { return ("unknown"); } It won't work so I delete it: <?php function uptime(){ $now = $times['ticks']; $days = intval($now / (60*60*24*100)); $remainder = $now % (60*60*24*100); $hours = intval($remainder / (60*60*100)); $remainder = $remainder % (60*60*100); $minutes = intval($remainder / (60*100)); if ($days == 1) {$writeDays = "day";} else {$writeDays = "days";} if ($hours == 1) {$writeHours = "hour"; } else {$writeHours = "hours";} if ($minutes == 1) {$writeMins = "minute";} else {$writeMins = "minutes";} return ("$days $writeDays, $hours $writeHours, $minutes $writeMins"); } ?> It works, but its says "0 days, 0 hours, 0 minutes", means It doesn't work properly.

« previous php.notes (#91646) next »