Statistics and Counters Php

$uptime = @exec('uptime');
preg_match("/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/",$uptime,$avgs);
$uptime = explode(' up ', $uptime);
$uptime = explode(',', $uptime[1]);
$uptime = $uptime[0].', '.$uptime[1];
$start=mktime(0, 0, 0, 1, 1, date("Y"), 0);
$end=mktime(0, 0, 0, date("m"), date("j"), date("y"), 0);
$diff=$end-$start;
$days=$diff/86400;
$percentage=($uptime/$days) * 100;
$load=$avgs[1].",".$avgs[2].",".$avgs[3]."";
$page='

Server Statistics For '.getenv('SERVER_NAME').'


































Server
Details
Server
Statistics
   
Name: '.getenv('SERVER_NAME').'
Uptime
(days): '.$uptime.'
Port:
'.getenv('SERVER_PORT').'
Uptime

(%): '.$percentage.'%
Software:

'.getenv('SERVER_SOFTWARE').'
Load:  '.$load.'
Protocol:  '.getenv('SERVER_PROTOCOL').'
Gateway: '.getenv('GATEWAY_INTERFACE').'
 



';
echo $page;
?>