Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Identifying server OS 1

Status
Not open for further replies.

csteinhilber

Programmer
Aug 2, 2002
1,291
US

I'm trying to develop a cross-platform script, and ended up having some platform-dependent portions. So I want to be able to identify what OS PHP is running on and act accordingly.

What's the best way to identify the server's OS (not the browser's)?
Hope it helps,
-Carl
 
I am not able to look right now but is that variable listed in the phpinfo() function?

<?php
phpinfo();
?>
 
Right you are, Jim!

Thanks much.

Code:
print($HTTP_ENV_VARS[&quot;OS&quot;]);
does the trick.

Of course... a list of possible values would be handy.

Hope it helps,
-Carl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top