Get server operating system in PHP
Sunday July 16th, 2006
This function returns 'win' if running on a Windows server and 'linux' if not running on a Windows server. It should be pretty easy to extend it to match other server operating systems, but this is all I needed.
PHP:
-
function operating_system()
-
/* Returns 'win' for a Windows server, 'linux' for others */
-
{
-
{
-
return 'win';
-
}
-
else
-
{
-
return 'linux';
-
}
-
}



