Definition: Getenv () is used to get the value of an environmental variable. It is written as Getenv (varname) ; Below are some examples of environmental variables you can use. If you are interested, you can see a full list by running phpinfo ().
Also Known As: Get Environment Variable
<?php //Gets the IP address $ip = getenv("REMOTE_ADDR") ; Echo "Your IP is " . $ip; ?>
<?php //Gets the document root $root = getenv("DOCUMENT_ROOT") ; Echo $root; ?>
<?php //Gets the server admin's email $ad = getenv("SERVER_ADMIN") ; Echo $ad; ?>