Or here's a function you can use.
function linuxUptime() {
$ut = strtok( exec( "cat /proc/uptime" ), "." );
$days = sprintf( "%2d", ($ut/(360024)) );
$hours = sprintf( "%2d", ( ($ut % (360024)) / 3600) );
$min = sprintf( "%2d", ($ut % (360024) % 3600)/60 );
$sec = sprintf( "%2d", ($ut % (360024) % 3600)%60 );
return array( $days, $hours, $min, $sec );
}
$ut = linuxUptime();
echo "Time since last reboot: $ut[0] days, $ut[1] hours, $ut[2] minutes";
Hope this helps
[ John Barker
[ john@dreamcastcenter.com