PHP $

Source: Internet
Author: User

The $_env in PHP stores some of the system's environment variables, depending on the environment and values.
But sometimes the $_env is empty and may have the following reasons:
The Variables_order value in PHP.ini is "gpcs", meaning that the order in which the system defines PHP predefined variables is get,post,cookies,server, and no Environment (E) is defined.

You can modify the Variables_order value of the php.ini file for the order you want, such as "Egpcs". At this point, the value of the $_env can be achieved
Egpcs Value: (Egpcs is the abbreviation for environment, GET, Post, Cookies, server-This is the entire range of external variable sources in PHP).

You can use foreach to traverse $_env data, or you can print the variable directly with Print_r ($_ENV) to view his data.


$_ENV records some system environment variables (because the actual operating system is involved, it is impossible to give a complete list of $_env).

The possible reasons for the $_env are:
The Variables_order value of your php.ini is "gpcs", which means that the order in which the system defines PHP predefined variables is get,post,cookies,server, and no Environment (E) is defined. You can modify the Variables_order value of the php.ini file for the order you want, such as "Egpcs". At this point, the value of the $_env can be achieved
Egpcs value (Egpcs is the abbreviation for environment, GET, Post, Cookies, server-This is the entire range of external variable sources in PHP)



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.