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 codeThe code is as follows:
If(strtolower(substr(PHP_OS, 0, 3)) == 'win'){
echo 'windows';
}else{
echo 'linux';
}
http://www.bkjia.com/PHPjc/825235.html
www.bkjia.com
true
http: //www.bkjia.com/PHPjc/825235.html
TechArticle
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_una...