For those that want seconds as well, here you go
PHP Code:
$result = mysql_query("show status");
while ($row = mysql_fetch_array($result)){
if ($row['Variable_name'] == "Uptime") { $uptime = $row['Value']; }
}
$days = ((($uptime/60)/60)/24);
$wholeday = (int) $days;
$hours = (($days - $wholeday)*24);
$wholehour = (int) $hours;
$minutes = (($hours - $wholehour)*60);
$wholeminute = (int) $minutes;
$seconds = (($minutes - $wholeminute)*60);
$wholesecond = (int) $seconds;
..for those who want 1 variable that has all the stuff in it, add this line below all the code:
PHP Code:
$sysuptime = "System Uptime: $wholeday Days $wholehour Hours $wholeminute Minutes";
..with seconds (see my code):
PHP Code:
$sysuptime = "System Uptime: $wholeday Days $wholehour Hours $wholeminute Minutes $wholesecond Seconds";
..then put $sysuptime where you want that line to show - enjoy.