PHP: Detect operating system from command line
Posted on 2007-11-21
I could do with a routine to be able to detect the current operating system from which php when it is run external to the web server. Please note: I am not interested in browser detection routines - they are not applicable and I know there are plenty of resources available for that. I am interested solely in detecting the operating system on which php is running upon.
So far, for MS Windows, the _ENV["OS"] and _SERVER["OS"] are useful, but these do not necessarily exist on other operating systems.