getenv() vs. $_ENV in PHP

后端 未结 7 1333
半阙折子戏
半阙折子戏 2020-12-05 02:00

What is the difference between getenv() and $_ENV?

Any trade-offs between using either?

I noticed sometimes getenv() g

7条回答
  •  北海茫月
    2020-12-05 02:19

    Taken from the PHP docs:

    This function is useful (compared to $_SERVER, $_ENV) because it searches $varname key in those array case-insensitive manner. For example on Windows $_SERVER['Path'] is like you see Capitalized, not 'PATH' as you expected. So just:

提交回复
热议问题