...

View Full Version : Check which OS



Masterslave
05-01-2006, 11:08 AM
How can I check which Operation System I use?
I want to do this


if (windows)
{
setlocale(LC_ALL, 'nld_nld');
}

else
{
setlocale(LC_ALL, 'nl_NL');
}
I looked in phpinfo but I can't find a super global the outputs which OS I'm using.

dumpfi
05-01-2006, 12:35 PM
Try PHP_OS.

dumpfi

vinyl-junkie
05-01-2006, 01:07 PM
I found a really cool script here (http://TechPatterns.com/downloads/php_browser_detection.php) that detects your browser and operating system, in case you're interested. Works great!

Masterslave
05-01-2006, 01:33 PM
I found a really cool script here (http://TechPatterns.com/downloads/php_browser_detection.php) that detects your browser and operating system, in case you're interested. Works great!Thanks, that will do.:thumbsup:

Masterslave
05-01-2006, 02:34 PM
I haven't use the script yet but it is a bit big for what I want to achieve as given in my startpost.:D
Anyone else with a solution to check which OS you're using?
I could not imagine that PHP has not this function...:rolleyes:

trib4lmaniac
05-01-2006, 03:18 PM
Dumpfi already told you.


if(PHP_OS == "WINNT") {
// Is Windows NT.
} else {
// Not Windows NT.
}
Of course you might not want to check for Windows NT, but it's the same principle.

Masterslave
05-01-2006, 03:49 PM
Ok sorry, I didn't understand his post.
But it works now, I've read at php.net about PHP_OS and php_uname().
It's very clear to me now. :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum