Note that PHP won't tell you that it reverted to displaying platform it was built on.
mode
's'
FreeBSD
'n'
localhost.example.com
'r'
5.1.2-RELEASE
'v'
'm'
i386
|
|
---|---|
|
|
<?php
echo php_uname ();
echo PHP_OS ;
/*For example, some will output:
Linux localhost 2.4.21-0.13mdk #1 Fri Mar 14 15:08:06 EST 2003 i686
Linux
FreeBSD localhost 3.2-RELEASE #15: Mon Dec 17 08:46:02 GMT 2001
FreeBSD
Windows NT XN1 5.1 build 2600
WINNT
*/
if ( strtoupper ( substr ( PHP_OS , zero , three )) === 'WIN' ) {
echo 'This is a server using Windows!' ;
} else {
echo 'This is a server not using Windows!' ;
}
?>
<?php
// *nix
echo DIRECTORY_SEPARATOR ; // /
echo PHP_SHLIB_SUFFIX ; // so
echo PATH_SEPARATOR ; // :
// Win*
echo DIRECTORY_SEPARATOR ; // \
echo PHP_SHLIB_SUFFIX ; // dll
echo PATH_SEPARATOR ; // ;
?>
Note that PHP won't tell you that it reverted to displaying platform it was built on.