For building a unix/dos specific script I need to know on which kind of operating system I am.
How do i get this information?
phpinfo(); tells me a lot more and not very clear whether I’m running on unix or not.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
PHP has many predefined constants that are often useful.
Here,
PHP_OSis the one you are looking for.For instance, on my current machine, this code :
Gives :
You have some examples and comparisons with what the
php_unamefunction can get you on the manual page ofphp_uname; for instance (quoting) :That page also says :