<?php
$uptime_array
=
explode
(
" "
,
exec
(
"cat /proc/uptime"
));
$seconds
=
round
(
$uptime_array
[0], 0);
$minutes
=
$seconds
/ 60;
$hours
=
$minutes
/ 60;
$days
=
floor
(
$hours
/ 24);
$hours
=
floor
(
$hours
- (
$days
* 24));
$minutes
=
floor
(
$minutes
- (
$days
* 24 * 60) - (
$hours
* 60));
$seconds
=
floor
(
$seconds
- (
$days
* 24 * 60 * 60) - (
$hours
* 60 * 60) -
(
$minutes
* 60));
$uptime_array
=
array
(
$days
,
$hours
,
$minutes
,
$seconds
);
if
(
$uptime_array
[0] == 0) {
if
(
$uptime_array
[1] == 0) {
if
(
$uptime_array
[2] == 0) {
print
(
"Bilgisayarin surekli acik oldugu sure: <b>"
.
$uptime_array
[3] .
" saniye</b>"
);
}
else
{
print
(
"Bilgisayarin surekli acik oldugu sure: <b>"
.
$uptime_array
[2] .
" dakika</b>"
);
}
}
else
{
print
(
"Bilgisayarin surekli acik oldugu sure: <b>"
.
$uptime_array
[1] .
" saat</b>"
);
}
}
else
{
print
(
"Bilgisayarin surekli acik oldugu sure: <b>"
.
$uptime_array
[0] .
" gun</b>"
);
}
?>