检查
PHP_OS常量_Docs_ 的值。
它会给你不同的值在Windows一样
WIN32,
WINNT或
Windows。
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { echo 'This is a server using Windows!';} else { echo 'This is a server not using Windows!';}
检查
PHP_OS常量_Docs_ 的值。
它会给你不同的值在Windows一样
WIN32,
WINNT或
Windows。
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { echo 'This is a server using Windows!';} else { echo 'This is a server not using Windows!';}