php-cli: What is the best way to detect the hosting OS? -


I have a script that I want to run on Windows under Sigwin and Linux. For two purposes I have to distinguish between two running environments. What is the best way to do this?

"post-text" itemprop = "text">

is a pre-defined constant PHP_OS that will help, but only shows OS that PHP was built on it, not on the OS Its going on.

That is what you want to find out about the current code:

php_uname () gives details of the operating system running on PHP is.

Specifically,

  php_uname ('s'); // The name of the operating system such as FreeBSD  

Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -