<?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 => 'it',
  ),
  'this' => 
  array (
    0 => 'function.ini-get.php',
    1 => 'ini_get',
    2 => 'Restituisce il valore delle opzioni di configurazione',
  ),
  'up' => 
  array (
    0 => 'ref.info.php',
    1 => 'PHP Options/Info Funzioni',
  ),
  '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' => 'it',
    '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">Restituisce il valore delle opzioni di configurazione</span></p>

   </div>
   <div class="refsect1 unknown-91" id="refsect1-function.ini-get-unknown-91">
    <h3 class="title">Descrizione</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">$varname</code></span>): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>

    <p class="para rdfs-comment">
     Restituisce il valore delle opzioni di configurazione.  In caso di errore, tipo
     la richiesta per un valore inesistente, sarà restituita una stringa vuota.
    </p>
    <blockquote class="note"><p><strong class="note">Nota</strong>: 
     <strong>Richieste per valori booleani</strong><br />
     <p class="para">
      Nel file ini, il valore booleano <code class="literal">off</code> sarà restituito come
      stringa vuota o &quot;0&quot;, mentre il valore <code class="literal">on</code> sarà restituito come
      &quot;1&quot;.
     </p>
    </p></blockquote>
    <blockquote class="note"><p><strong class="note">Nota</strong>: 
     <strong>Richieste per le dimensioni della memoria</strong><br />
     <p class="para">
      Diversi parametri attinenti alle dimensioni di memoria, tipo
      <a href="ini.core.php#ini.upload-max-filesize" class="link">upload_max_filesize</a>
      sono registrati nel <var class="filename">php.ini</var> in notazione abbreviata. La funzione <span class="function"><strong>ini_get()</strong></span>
      restituirà l&#039;esatto valore presente nel <var class="filename">php.ini</var>, e <em>NON</em>
      l&#039;<span class="type">intero</span> equivalente. L&#039;esecuzione delle normali funzioni aritmetiche su questi valori
      potrà dare risultati inattesi. L&#039;esempio seguente illustra come
      si possa convertire la notazione breve in byte in modo molto simile a come
      fa il PHP.
     </p>
    </p></blockquote>
    <p class="para">
     <div class="example" id="example-1">
      <p><strong>Example #1 Qualche esempio di <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 /></span><span style="color: #FF8000">/*<br />Il nostro php.ini contiene i seguenti parametri:<br /><br />display_errors = On<br />register_globals = 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">'register_globals = ' </span><span style="color: #007700">. </span><span style="color: #0000BB">ini_get</span><span style="color: #007700">(</span><span style="color: #DD0000">'register_globals'</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">ini_get</span><span style="color: #007700">(</span><span style="color: #DD0000">'post_max_size'</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">return_bytes</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 />function </span><span style="color: #0000BB">return_bytes</span><span style="color: #007700">(</span><span style="color: #0000BB">$val</span><span style="color: #007700">) {<br />    </span><span style="color: #0000BB">$val </span><span style="color: #007700">= </span><span style="color: #0000BB">trim</span><span style="color: #007700">(</span><span style="color: #0000BB">$val</span><span style="color: #007700">);<br />    </span><span style="color: #0000BB">$last </span><span style="color: #007700">= </span><span style="color: #0000BB">$val</span><span style="color: #007700">{</span><span style="color: #0000BB">strlen</span><span style="color: #007700">(</span><span style="color: #0000BB">$val</span><span style="color: #007700">)-</span><span style="color: #0000BB">1</span><span style="color: #007700">};<br />    switch(</span><span style="color: #0000BB">$last</span><span style="color: #007700">) {<br />        case </span><span style="color: #DD0000">'k'</span><span style="color: #007700">:<br />        case </span><span style="color: #DD0000">'K'</span><span style="color: #007700">:<br />            return (int) </span><span style="color: #0000BB">$val </span><span style="color: #007700">* </span><span style="color: #0000BB">1024</span><span style="color: #007700">;<br />            break;<br />        case </span><span style="color: #DD0000">'m'</span><span style="color: #007700">:<br />        case </span><span style="color: #DD0000">'M'</span><span style="color: #007700">:<br />            return (int) </span><span style="color: #0000BB">$val </span><span style="color: #007700">* </span><span style="color: #0000BB">1048576</span><span style="color: #007700">;<br />            break;<br />        default:<br />            return </span><span style="color: #0000BB">$val</span><span style="color: #007700">;<br />    }<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
       </div>

       <div class="example-contents"><p>
        Lo script produrrà:
       </p></div>
       <div class="example-contents screen">
<div class="cdata"><pre>

display_errors = 1
register_globals = 0
post_max_size = 8M
post_max_size+1 = 9
post_max_size in bytes = 8388608
</pre></div>
       </div>
      </div>
     </p>
    <p class="para">
     Vedere anche:
     <span class="function"><a href="function.get-cfg-var.php" class="function">get_cfg_var()</a></span>,
     <span class="function"><a href="function.ini-get-all.php" class="function">ini_get_all()</a></span>,
     <span class="function"><a href="function.ini-restore.php" class="function">ini_restore()</a></span> e
     <span class="function"><a href="function.ini-set.php" class="function">ini_set()</a></span>.
    </p>
   </div>

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