<HTML ><HEAD ><TITLE >getenv</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.44"><LINK REL="HOME" TITLE="PHP Manual" HREF="manual.html"><LINK REL="UP" TITLE="PHP options & information" HREF="ref.info.html"><LINK REL="PREVIOUS" TITLE="extension_loaded" HREF="function.extension-loaded.html"><LINK REL="NEXT" TITLE="get_cfg_var" HREF="function.get-cfg-var.html"></HEAD ><BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >PHP Manual</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.extension-loaded.html" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.get-cfg-var.html" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.getenv" >getenv</A ></H1 ><DIV CLASS="refnamediv" ><A NAME="AEN23093" ></A >getenv -- Get the value of an environment variable</DIV ><DIV CLASS="refsect1" ><A NAME="AEN23096" ></A ><H2 >Description</H2 ><DIV CLASS="funcsynopsis" ><P ></P ><CODE CLASS="FUNCDEF" >string getenv</CODE >(string varname);<P ></P ></DIV ><P > Returns the value of the environment variable <TT CLASS="parameter" ><I >varname</I ></TT >, or false on an error. <DIV CLASS="informalexample" ><P ></P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" WIDTH="100%" ><TR ><TD ><PRE CLASS="programlisting" > 1 2 $ip = getenv("REMOTE_ADDR"); // get the ip number of the user 3 </PRE ></TD ></TR ></TABLE ><P ></P ></DIV > </P ><P > You can see a list of all the environmental variables by using <A HREF="function.phpinfo.html" ><B CLASS="function" >phpinfo()</B ></A >. You can find out what many of them mean by taking a look at the <A HREF="http://hoohoo.ncsa.uiuc.edu/cgi/" TARGET="_top" >CGI specification</A >, specifically the <A HREF="http://hoohoo.ncsa.uiuc.edu/cgi/env.html" TARGET="_top" >page on environmental variables</A >. </P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.extension-loaded.html" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="manual.html" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.get-cfg-var.html" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >extension_loaded</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.info.html" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >get_cfg_var</TD ></TR ></TABLE ></DIV ></BODY ></HTML >