$_env in PHP is an array that contains server-side environment variables. It is a super global variable in PHP, and we can access it directly from anywhere in the PHP program. $_env just passively accept the server-side environment variables and convert them to an array element, you can try to output it directly, many of them are determined by the system that PHP runs, the complete list is not possible, you need to look at the PHP server's system documentation to determine its specific environment variables. Like $_server, this is an automatic global variable that works in all scripts and does not require the global keyword to access it in the method of a function or object. In the following example, the foreach statement is used to output all the environment-related information about the server in PHP that is available to the user for viewing.
$_env documented some system environment variables (because of the actual operating system involved, so it is not possible to give a complete list of $_env).
But some friends ' $_env are empty, possibly because:
The Variables_order value of your php.ini is "gpcs", that is, the system defines the order of PHP predefined variables is get,post,cookies,server, there is no definition environment (E), You can modify the Variables_order value of the php.ini file to the order you want, such as: "Egpcs". At this point, the value of the $_env can be obtained
Egpcs Value (egpcs is environment, Get, Post, cookie, server abbreviation-this is the entire range of external variable sources in PHP)