Re: uptime and php

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Richard Whitney
Date:  
To: plug-discuss
Subject: Re: uptime and php
Quoting mike hoy <>:

> Gurus of computer wisdom...
>
> for the heck of it decided to add #uptime to my site
>
> just to hopefully one day brag how long my linux server has been running
>
> so i found a php function that displays uptime:
>
> <?php

      $uptime = exec('uptime');

>     $up = explode(',',$uptime);

      $updays = explode(' up ',$up);
      echo $updays[1];

> ?>
>
> the only problem is that #uptime outputs too much info..
>
> ex: 13:11:38 up 12 days, 21:40, 4 users, load average: 0.00, 0.00, 0.02
>
> I check the man page to see if there was a flag that I could use with
> #uptime so I would only get something like
>
> 12 days
>
>
> any ideas?
>
> mike h
>
> ---------------------------------------------------
> PLUG-discuss mailing list -
> To subscribe, unsubscribe, or to change you mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>



R. Whitney
Transcend Development
"Producing the next phase of your internet presence"
http://xend.net
Premium Quality Web Hosting
http://xendhosting.com
rw AT xend.net
Net Binder http://netbinder.net
310-943-6498
602-288-5340

---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss