What is the difference between
According to the php documentation about getenv, they are exactly the same, except that
getenv will look for the variable in a case-insensitive manner. Most of the time it probably doesn't matter, but one of the comments on the documentation explains:
For example on Windows $_SERVER['Path'] is like you see, with the first letter capitalized, not 'PATH' as you might expect.
Because of that, I would probably opt to use
getenv unless you are certain about the casing of the title of the variable you are trying to retrieve.