Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Environment Variables with PHP!
You have completed Environment Variables with PHP!
Environment variable changes based on the current system. There are a number of environment variables that are set by default, which we can access right away. We'll look at what they are and how we can use them.
Learn About Your Environment
phpinfo allows us to gather a lot of information about our environment. Among these details, we can see the version of PHP that is being run and the default environment variable that are set. Check the section for "Apache Environment" and "Additional Modules".
getenv — Gets the value of an environment variable.
string getenv ( string $varname [, bool $local_only = FALSE ] )
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up