• 0

PHP - Windows Server Uptime


Question

I hope, that if you're a 'serious' coder you already know how to do uptime for a linux box. Although Windows isn't so easy to todo. Although, here's a small contribution from me to you.

Uptime String on Windows

<?php
echo exec('Systeminfo | Find "Up Time"');
?> 

Uptime String on Linux

<?php
echo @exec('uptime');
?> 

.. u can play with the linux version to limit it down to just that.. uptime.

Link to comment
https://www.neowin.net/forum/topic/407858-php-windows-server-uptime/
Share on other sites

2 answers to this question

Recommended Posts

  • 0

1. Simply, because I can. 2. It was simple; A good coder, should already know how to do it on Linux it's a very simple task. Although, I have seen a lot of advanced (supposed) coders asking about how to do it on windows - I've noticed a lot of people asking about it on multipe websites.

Notice, whether there was arrogance or not in my post - I supplied the linux version, for those who 'didn`t' know. ;)

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.