<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.info.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.ini-get.php',
    1 => 'ini_get',
    2 => 'Lit la valeur d\'une option de configuration',
  ),
  'up' => 
  array (
    0 => 'ref.info.php',
    1 => 'Fonctions sur les options et les informations de PHP',
  ),
  'prev' => 
  array (
    0 => 'function.ini-alter.php',
    1 => 'ini_alter',
  ),
  'next' => 
  array (
    0 => 'function.ini-get-all.php',
    1 => 'ini_get_all',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/info/functions/ini-get.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.ini-get" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ini_get</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">ini_get</span> &mdash; <span class="dc-title">Lit la valeur d&#039;une option de configuration</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.ini-get-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>ini_get</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$option</code></span>): <span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Retourne la valeur de l&#039;option de configuration
   <code class="parameter">option</code> en cas de succès.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.ini-get-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">option</code></dt>
     <dd>
      <p class="para">
       Le nom de l&#039;option de configuration.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.ini-get-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Retourne la valeur de l&#039;option de configuration
   <code class="parameter">option</code> en cas de succès, ou une
   <a href="language.types.string.php" class="link">chaîne de caractères</a> vide pour les valeurs <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>. Retourne <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>
   si l&#039;option de configuration n&#039;existe pas.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.ini-get-examples">
  <h3 class="title">Exemples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Exemple #1 Exemples avec <span class="function"><strong>ini_get()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">/*<br />Notre fichier php.ini contient les directives suivantes :<br /><br />display_errors = On<br />opcache.enable_cli = Off<br />post_max_size = 8M<br />*/<br /><br /></span><span style="color: #007700">echo </span><span style="color: #DD0000">'display_errors = ' </span><span style="color: #007700">. </span><span style="color: #0000BB">ini_get</span><span style="color: #007700">(</span><span style="color: #DD0000">'display_errors'</span><span style="color: #007700">) . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />echo </span><span style="color: #DD0000">'opcache.enable_cli = ' </span><span style="color: #007700">. (int) </span><span style="color: #0000BB">ini_get</span><span style="color: #007700">(</span><span style="color: #DD0000">'opcache.enable_cli'</span><span style="color: #007700">) . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />echo </span><span style="color: #DD0000">'post_max_size = ' </span><span style="color: #007700">. </span><span style="color: #0000BB">ini_get</span><span style="color: #007700">(</span><span style="color: #DD0000">'post_max_size'</span><span style="color: #007700">) . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />echo </span><span style="color: #DD0000">'post_max_size + 1 = ' </span><span style="color: #007700">. (</span><span style="color: #0000BB">rtrim</span><span style="color: #007700">(</span><span style="color: #0000BB">ini_get</span><span style="color: #007700">(</span><span style="color: #DD0000">'post_max_size'</span><span style="color: #007700">), </span><span style="color: #DD0000">'KMG'</span><span style="color: #007700">) + </span><span style="color: #0000BB">1</span><span style="color: #007700">) . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />echo </span><span style="color: #DD0000">'post_max_size in bytes = ' </span><span style="color: #007700">. </span><span style="color: #0000BB">ini_parse_quantity</span><span style="color: #007700">(</span><span style="color: #0000BB">ini_get</span><span style="color: #007700">(</span><span style="color: #DD0000">'post_max_size'</span><span style="color: #007700">));<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>Résultat de l&#039;exemple ci-dessus est similaire à :</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">display_errors = 1
opcache.enable_cli = 0
post_max_size = 8M
post_max_size+1 = 9
post_max_size in bytes = 8388608</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.ini-get-notes">
  <h3 class="title">Notes</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <strong>Lecture de valeurs booléennes</strong><br />
   <p class="para">
    Une directive de configuration ayant la valeur de <code class="literal">off</code>
    sera retournée sous la forme d&#039;une chaîne vide ou &quot;0&quot; alors que
    la valeur <code class="literal">on</code> retournera &quot;<code class="literal">1</code>&quot;.
    Cette fonction peut également retourner la valeur littérale
    du fichier INI.
   </p>
  </p></blockquote>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <strong>Lors de la lecture des tailles de mémoire</strong><br />
   <p class="para">
    Plusieurs directives traitant de taille mémoire, comme
    <a href="ini.core.php#ini.upload-max-filesize" class="link">upload_max_filesize</a>, sont stockées
    dans le fichier <var class="filename">php.ini</var> avec une notation courte. <span class="function"><strong>ini_get()</strong></span>
    retourne la chaîne exacte stockée dans le fichier <var class="filename">php.ini</var> et
    <em>NON PAS</em> son équivalent <a href="language.types.integer.php" class="link">entier</a>. Appliquer des opérations
    arithmétiques classiques sur ces valeurs ne conduira à rien de bon. La fonction
    <span class="function"><a href="function.ini-parse-quantity.php" class="function">ini_parse_quantity()</a></span> peut être utilisée pour convertir
    la notation abrégée en octets.
   </p>
  </p></blockquote>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    <span class="function"><strong>ini_get()</strong></span> ne peut pas lire les options ini de type 
    &quot;array&quot; tel que <code class="literal">pdo.dsn.<span class="replaceable">*</span></code>, et retourne <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> dans ce cas.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.ini-get-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.get-cfg-var.php" class="function" rel="rdfs-seeAlso">get_cfg_var()</a> - Retourne la valeur d'une option de PHP</span></li>
    <li><span class="function"><a href="function.ini-get-all.php" class="function" rel="rdfs-seeAlso">ini_get_all()</a> - Lit toutes les valeurs de configuration</span></li>
    <li><span class="function"><a href="function.ini-parse-quantity.php" class="function" rel="rdfs-seeAlso">ini_parse_quantity()</a> - Renvoie la taille interpr&eacute;t&eacute;e &agrave; partir de la syntaxe abr&eacute;g&eacute;e ini</span></li>
    <li><span class="function"><a href="function.ini-restore.php" class="function" rel="rdfs-seeAlso">ini_restore()</a> - Restaure la valeur de l'option de configuration</span></li>
    <li><span class="function"><a href="function.ini-set.php" class="function" rel="rdfs-seeAlso">ini_set()</a> - Modifie la valeur d'une option de configuration</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>