🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
>[danger] getenv() 获取系统的环境变量 ```php // 返回 PATH 环境变量的值 getenv('PATH') ``` >[danger] 示例 ``` var_dump(explode(';', getenv('PATH'))); /** array(23) { [0]=> string(17) "D:\software\xftp\" [1]=> string(20) "D:\software\xsheel6\" [2]=> string(19) "C:\Windows\system32" [3]=> string(10) "C:\Windows" [4]=> string(24) "C:\Windows\System32\Wbem" [5]=> string(43) "C:\Windows\System32\WindowsPowerShell\v1.0\" [6]=> string(56) "D:\phpstudy-v8.1\phpstudy_pro\Extensions\MySQL5.7.26\bin" [7]=> string(42) "D:\phpstudy\PHPTutorial\php\php-7.1.13-nts" [8]=> string(31) "D:\software\Git-2.24.0.2-64\cmd" [9]=> string(28) "D:\software\nodejs-v12.13.1\" [10]=> string(32) "C:\ProgramData\ComposerSetup\bin" [11]=> string(59) "C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\" [12]=> string(53) "C:\Program Files\Microsoft SQL Server\100\Tools\Binn\" [13]=> string(51) "C:\Program Files\Microsoft SQL Server\100\DTS\Binn\" [14]=> string(79) "C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\" [15]=> string(57) "C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\" [16]=> string(19) "C:\PROGRA~2\tigerzz" [17]=> string(58) "C:\Users\Administrator\AppData\Roaming\Composer\vendor\bin" [18]=> string(48) "C:\Users\Administrator\AppData\Local\BypassRuntm" [19]=> string(33) "D:\software\PhpStorm 2019.2.3\bin" [20]=> string(26) "C:\Program Files\Bandizip\" [21]=> string(42) "C:\Users\Administrator\AppData\Roaming\npm" [22]=> string(32) "D:\software\PhpStorm2019.3.3\bin" } */ ```