1: PHP has many system predefined variables. By judging them, you can easily determine whether the server system is windows or *unix. The relevant functions or predefined variables are as follows:
php_uname(), PHP_OS, DIRECTORY_SEPARATOR, PHP_SHLIB_SUFFIX ,PATH_SEPARATOR
Two: Example:
Copy code The code is as follows:
If(strtolower(substr(PHP_OS, 0, 3)) == 'win'){
echo 'windows';
}else{
echo 'linux';
}
http://www.bkjia.com/PHPjc/825235.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/825235.htmlTechArticle1: PHP has many system predefined variables. By judging them, you can easily determine whether the server system is windows or *unix. , the relevant functions or predefined variables are as follows: php_una...