<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.strings.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'function.localeconv.php',
    1 => 'localeconv',
    2 => 'Ottiene informazioni sul formato numerico',
  ),
  'up' => 
  array (
    0 => 'ref.strings.php',
    1 => 'String Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.levenshtein.php',
    1 => 'levenshtein',
  ),
  'next' => 
  array (
    0 => 'function.ltrim.php',
    1 => 'ltrim',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'it',
    'path' => 'reference/strings/functions/localeconv.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.localeconv" class="refentry">
   <div class="refnamediv">
    <h1 class="refname">localeconv</h1>
    <p class="verinfo">(PHP 4 &gt;= 4.0.5, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">localeconv</span> &mdash; <span class="dc-title">Ottiene informazioni sul formato numerico</span></p>

   </div>
   <div class="refsect1 unknown-1309" id="refsect1-function.localeconv-unknown-1309">
    <h3 class="title">Descrizione</h3>
     <div class="methodsynopsis dc-description">
      <span class="methodname"><strong>localeconv</strong></span>(): <span class="type"><a href="language.types.array.php" class="type array">array</a></span></div>

    <p class="para rdfs-comment">
     La funzione restituisce un array associativo contenente le configurazioni locali
     per il formato numerico e monetario.
    </p>
    <p class="para">
     La funzione <span class="function"><strong>localeconv()</strong></span> restituisce i dati in base alle configurazioni locali
     come impostate da <span class="function"><a href="function.setlocale.php" class="function">setlocale()</a></span>.  L&#039;array associativo restituito contiene 
     i seguenti campi:
     <table class="doctable informaltable">
      
       <thead>
        <tr>
         <th>Elemento</th>
         <th>Descrizione</th>
        </tr>

       </thead>

       <tbody class="tbody">
        <tr>
         <td>decimal_point</td>
         <td>Carattere per il punto decimale</td>
        </tr>

        <tr>
         <td>thousands_sep</td>
         <td>Separatore delle migliaia</td>
        </tr>

        <tr>
         <td>grouping</td>
         <td>Array contenente i gruppi numerici</td>
        </tr>

        <tr>
         <td>int_curr_symbol</td>
         <td>Simbolo internazionale della divisa (i.e. USD)</td>
        </tr>

        <tr>
         <td>currency_symbol</td>
         <td>Simbolo della divisa locale (i.e. $)</td>
        </tr>

        <tr>
         <td>mon_decimal_point</td>
         <td>Carattere per il punto decimale nella moneta</td>
        </tr>

        <tr>
         <td>mon_thousands_sep</td>
         <td>Separatore delle migliaia nella moneta</td>
        </tr>

        <tr>
         <td>mon_grouping</td>
         <td>Array contenente i gruppi monetari</td>
        </tr>

        <tr>
         <td>positive_sign</td>
         <td>Segno per i valori positivi</td>
        </tr>

        <tr>
         <td>negative_sign</td>
         <td>Segno per i valori negativi</td>
        </tr>

        <tr>
         <td>int_frac_digits</td>
         <td>Numero di caratteri frazionali internazionali</td>
        </tr>

        <tr>
         <td>frac_digits</td>
         <td>Numero di caratteri frazionali locali</td>
        </tr>

        <tr>
         <td>p_cs_precedes</td>
         <td>
          <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> se il simbolo della divisa precede i valori positivi, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>
          se segue tali valori
         </td>
        </tr>

        <tr>
         <td>p_sep_by_space</td>
         <td>
          <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> se uno spazio separa il simbolo della divisa dai valori positivi
          <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> in caso contrario
         </td>
        </tr>

        <tr>
         <td>n_cs_precedes</td>
         <td>
          <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> se il simbolo della divisa precede i valori negativi, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>
          se segue tali valori
         </td>
        </tr>

        <tr>
         <td>n_sep_by_space</td>
         <td>
          <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> se uno spazio separa il simbolo della divisa dai valori negativi,
          <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> in caso contrario
         </td>
        </tr>

        <tr style="vertical-align: top;">
         <td>p_sign_posn</td>
         <td>
          <table class="simplelist">
              <tbody>
               <tr>
                <td>0</td>
                <td>
            Parentesi attorno alla quantità ed al simbolo della divisa
           </td>
               </tr>
               <tr>
                <td>1</td>
                <td>
            Il segno precede la quantità ed al simbolo della divisa
           </td>
               </tr>
               <tr>
                <td>2</td>
                <td>
            Il segno segue la quantità ed al simbolo della divisa
           </td>
               </tr>
               <tr>
                <td>3</td>
                <td>
            Il segno precede immediatamente il simbolo della divisa
           </td>
               </tr>
               <tr>
                <td>4</td>
                <td>
            Il segno segue immediatamente il simbolo della divisa
           </td>
               </tr>
               <tr>
                <td></td>
                <td></td>
               </tr>
              </tbody>
             </table>
         </td>
        </tr>

        <tr style="vertical-align: top;">
         <td>n_sign_posn</td>
         <td>
          <table class="simplelist">
              <tbody>
               <tr>
                <td>0</td>
                <td>
            Parentesi attorno alla quantità ed al simbolo della divisa
           </td>
               </tr>
               <tr>
                <td>1</td>
                <td>
             Il segno precede la quantità ed al simbolo della divisa
           </td>
               </tr>
               <tr>
                <td>2</td>
                <td>
            Il segno segue la quantità ed al simbolo della divisa
           </td>
               </tr>
               <tr>
                <td>3</td>
                <td>
            Il segno precede immediatamente il simbolo della divisa
           </td>
               </tr>
               <tr>
                <td>4</td>
                <td>
            Il segno segue immediatamente il simbolo della divisa
           </td>
               </tr>
               <tr>
                <td></td>
                <td></td>
               </tr>
              </tbody>
             </table>
         </td>
        </tr>

       </tbody>
      
     </table>

    </p>
    <p class="para">
     I campi di raggruppamento contengono matrici che definiscono il modo con cui
     i numeri dovrebbero essere raggruppati. Ad esempio, i campi di raggruppamento per il formato en_US,
     contengono due elementi con i valori 3 e 3.
     L&#039;indice più alto indica quanto è distinta il gruppo di sinistra.
     Se un elemento della matrice è uguale a CHAR_MAX, non vi sono
     più gruppi. Se nella matrice vi è un elemento a 0, occorre
     utilizzare l&#039;elemento precedente.
    </p>
    <div class="example" id="example-1">
     <p><strong>Example #1 Esempio di uso di <span class="function"><strong>localeconv()</strong></span></strong></p>
     <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />setlocale</span><span style="color: #007700">(</span><span style="color: #0000BB">LC_ALL</span><span style="color: #007700">, </span><span style="color: #DD0000">"en_US"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$locale_info </span><span style="color: #007700">= </span><span style="color: #0000BB">localeconv</span><span style="color: #007700">();<br /><br />echo </span><span style="color: #DD0000">"&lt;pre&gt;\n"</span><span style="color: #007700">;<br />echo </span><span style="color: #DD0000">"--------------------------------------------\n"</span><span style="color: #007700">;<br />echo </span><span style="color: #DD0000">"  Informazioni sulla configurazione monetaria locale:  \n"</span><span style="color: #007700">;<br />echo </span><span style="color: #DD0000">"--------------------------------------------\n\n"</span><span style="color: #007700">;<br /><br />echo </span><span style="color: #DD0000">"int_curr_symbol:   </span><span style="color: #007700">{</span><span style="color: #0000BB">$locale_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"int_curr_symbol"</span><span style="color: #007700">]}</span><span style="color: #DD0000">\n"</span><span style="color: #007700">;<br />echo </span><span style="color: #DD0000">"currency_symbol:   </span><span style="color: #007700">{</span><span style="color: #0000BB">$locale_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"currency_symbol"</span><span style="color: #007700">]}</span><span style="color: #DD0000">\n"</span><span style="color: #007700">;<br />echo </span><span style="color: #DD0000">"mon_decimal_point: </span><span style="color: #007700">{</span><span style="color: #0000BB">$locale_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"mon_decimal_point"</span><span style="color: #007700">]}</span><span style="color: #DD0000">\n"</span><span style="color: #007700">;<br />echo </span><span style="color: #DD0000">"mon_thousands_sep: </span><span style="color: #007700">{</span><span style="color: #0000BB">$locale_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"mon_thousands_sep"</span><span style="color: #007700">]}</span><span style="color: #DD0000">\n"</span><span style="color: #007700">;<br />echo </span><span style="color: #DD0000">"positive_sign:     </span><span style="color: #007700">{</span><span style="color: #0000BB">$locale_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"positive_sign"</span><span style="color: #007700">]}</span><span style="color: #DD0000">\n"</span><span style="color: #007700">;<br />echo </span><span style="color: #DD0000">"negative_sign:     </span><span style="color: #007700">{</span><span style="color: #0000BB">$locale_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"negative_sign"</span><span style="color: #007700">]}</span><span style="color: #DD0000">\n"</span><span style="color: #007700">;<br />echo </span><span style="color: #DD0000">"int_frac_digits:   </span><span style="color: #007700">{</span><span style="color: #0000BB">$locale_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"int_frac_digits"</span><span style="color: #007700">]}</span><span style="color: #DD0000">\n"</span><span style="color: #007700">;<br />echo </span><span style="color: #DD0000">"frac_digits:       </span><span style="color: #007700">{</span><span style="color: #0000BB">$locale_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"frac_digits"</span><span style="color: #007700">]}</span><span style="color: #DD0000">\n"</span><span style="color: #007700">;<br />echo </span><span style="color: #DD0000">"p_cs_precedes:     </span><span style="color: #007700">{</span><span style="color: #0000BB">$locale_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"p_cs_precedes"</span><span style="color: #007700">]}</span><span style="color: #DD0000">\n"</span><span style="color: #007700">;<br />echo </span><span style="color: #DD0000">"p_sep_by_space:    </span><span style="color: #007700">{</span><span style="color: #0000BB">$locale_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"p_sep_by_space"</span><span style="color: #007700">]}</span><span style="color: #DD0000">\n"</span><span style="color: #007700">;<br />echo </span><span style="color: #DD0000">"n_cs_precedes:     </span><span style="color: #007700">{</span><span style="color: #0000BB">$locale_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"n_cs_precedes"</span><span style="color: #007700">]}</span><span style="color: #DD0000">\n"</span><span style="color: #007700">;<br />echo </span><span style="color: #DD0000">"n_sep_by_space:    </span><span style="color: #007700">{</span><span style="color: #0000BB">$locale_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"n_sep_by_space"</span><span style="color: #007700">]}</span><span style="color: #DD0000">\n"</span><span style="color: #007700">;<br />echo </span><span style="color: #DD0000">"p_sign_posn:       </span><span style="color: #007700">{</span><span style="color: #0000BB">$locale_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"p_sign_posn"</span><span style="color: #007700">]}</span><span style="color: #DD0000">\n"</span><span style="color: #007700">;<br />echo </span><span style="color: #DD0000">"n_sign_posn:       </span><span style="color: #007700">{</span><span style="color: #0000BB">$locale_info</span><span style="color: #007700">[</span><span style="color: #DD0000">"n_sign_posn"</span><span style="color: #007700">]}</span><span style="color: #DD0000">\n"</span><span style="color: #007700">;<br />echo </span><span style="color: #DD0000">"&lt;/pre&gt;\n"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
     </div>

    </div>
    <p class="para">
     E&#039; presente una costante, CHAR_MAX, per gli utilizzi descritti in precedenza.
    </p>
    <p class="para">
     Vedere anche <span class="function"><a href="function.setlocale.php" class="function">setlocale()</a></span>.
    </p>
   </div>

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