<HTML ><HEAD ><TITLE >ini_get</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK REL="HOME" TITLE="PHP Manual" HREF="index.html"><LINK REL="UP" TITLE="PHP Options&Information" HREF="ref.info.html"><LINK REL="PREVIOUS" TITLE="ini_get_all" HREF="function.ini-get-all.html"><LINK REL="NEXT" TITLE="ini_restore" HREF="function.ini-restore.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=ISO-8859-1"></HEAD ><BODY CLASS="refentry" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation 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.ini-get-all.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.ini-restore.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.ini-get" ></A >ini_get</H1 ><DIV CLASS="refnamediv" ><A NAME="AEN73997" ></A ><P > (PHP 4 )</P >ini_get -- Gets the value of a configuration option</DIV ><DIV CLASS="refsect1" ><A NAME="AEN74000" ></A ><H2 >Description</H2 >string <B CLASS="methodname" >ini_get</B > ( string varname)<BR ></BR ><P > Returns the value of the configuration option on success. Failure, such as querying for a non-existant value, will return an empty string. </P ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >When querying boolean values: </B > A boolean ini value of <TT CLASS="literal" >off</TT > will be returned as an empty string while a boolean ini value of <TT CLASS="literal" >on</TT > will be returned as "1". </P ></BLOCKQUOTE ></DIV ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >When querying memory size values: </B > Many ini memory size values, such as <TT CLASS="literal" >upload_max_filesize</TT > are stored in the .ini file in shorthand notation. <B CLASS="function" >ini_get()</B > will return the exact string stored in the php.ini file, <SPAN CLASS="emphasis" ><I CLASS="emphasis" >NOT</I ></SPAN > its integer equivalent. Attempting normal arithmetic functions on these values will not have otherwise expected results. <DIV CLASS="informalexample" ><A NAME="AEN74020" ></A ><P ></P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><PRE CLASS="php" ><?php /* Our php.ini contains the following settings: display_errors = On register_globals = Off post_max_size = 8M */ print 'display_errors = ' . ini_get('display_errors') . "\n"; print 'register_globals = ' . ini_get('register_globals') . "\n"; print 'post_max_size = ' . ini_get('post_max_size') . "\n"; print 'post_max_size+1 = ' . (ini_get('post_max_size')+1) . "\n"; /* This script will produce: display_errors = 1 register_globals = post_max_size = 8M post_max_size+1 = 9 */ ?></PRE ></TD ></TR ></TABLE ><P ></P ></DIV > </P ></BLOCKQUOTE ></DIV ><P > See also <A HREF="function.get-cfg-var.html" ><B CLASS="function" >get_cfg_var()</B ></A >, <A HREF="function.ini-get-all.html" ><B CLASS="function" >ini_get_all()</B ></A >, <A HREF="function.ini-alter.html" ><B CLASS="function" >ini_alter()</B ></A >, <A HREF="function.ini-restore.html" ><B CLASS="function" >ini_restore()</B ></A >, and <A HREF="function.ini-set.html" ><B CLASS="function" >ini_set()</B ></A > </P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.ini-get-all.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.ini-restore.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >ini_get_all</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.info.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >ini_restore</TD ></TR ></TABLE ></DIV ></BODY ></HTML >