Reputation: 32023
I'm using an Apache 2 server and hosting a web app there. I'm setting some environment variables in my vhost by using the Apache SetEnv VARIABLE value
command.
When looking to retrieve the value in PHP, I've some across two methods. getenv()
and apache_getenv()
.
Is there any real difference? Is there a reason to prefer one over the other? Not sure what the point of have the apache_getenv()
method is if getenv()
works the same and allows your code to be server agnostic.
Upvotes: 5
Views: 1997