Possible Duplicate:
How to get the OS on which PHP is running?
I need my script to be able to recognize whether it’s being run on a Windows or on a Linux system so it can behave accordingly. How do I do that?
EDIT: I need a definite way of doing that, that has no risk of recognizing the wrong OS.
php_unameand/or thePHP_OSconstant will tell you. See the examples here: http://www.php.net/manual/en/function.php-uname.php