 <p>Note that <a href="http://php.net/manual/en/function.php-uname.php">PHP_OS reports the OS that PHP was <em>built</em> on</a>, which is not necessarily the same OS that it is currently running on.</p> <p>If you are on PHP >= 5.3 and just need to know whether you're running on Windows or not-Windows then testing whether one of the <a href="http://php.net/manual/en/info.constants.php">Windows-specific constants</a> is defined may be a good bet, e.g.:</p> <pre><code>$windows = defined('PHP_WINDOWS_VERSION_MAJOR'); </code></pre>