Your host:
Stephen Chapman
Stephen Chapman

Environment Variables

You can retrieve individual environment variables from within your PHP program using:


$_ENV('fieldname');

Of course to use that call you need to know what the fieldname is for the environment variable that you want. If you want to retrieve all of the environment variables then you can adapt the following code:


while (list ($key, $val) = each ($_ENV))
{
echo "$key : $val<br />";}

That code outputs the complete list of all of the environment variables into your web page. If instead you want to process the variables within your page you just need to replace the echo statement with your required code for processing each individual variable.

go to top

Add to del.icio.us

Loans - Guitar Lessons - Car Insurance - Credit Cards