<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.misc.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'function.highlight-string.php',
    1 => 'highlight_string',
    2 => 'Evidenziatore di sintassi per stringhe',
  ),
  'up' => 
  array (
    0 => 'ref.misc.php',
    1 => 'Misc. Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.highlight-file.php',
    1 => 'highlight_file',
  ),
  'next' => 
  array (
    0 => 'function.hrtime.php',
    1 => 'hrtime',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'it',
    'path' => 'reference/misc/functions/highlight-string.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.highlight-string" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">highlight_string</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">highlight_string</span> &mdash; <span class="dc-title">Evidenziatore di sintassi per stringhe</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.highlight-string-description">
  <h3 class="title">Descrizione</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>highlight_string</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$str</code></span>, <span class="methodparam"><span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span> <code class="parameter">$return</code><span class="initializer"> = false</span></span>): <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span></div>

  <p class="simpara">
   Stampa o ritorna il markup html per una versione con sintassi evidenziata del codice PHP passato
   usando i colori predefiniti nel syntax highlighter built-in per PHP.
   </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.highlight-string-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">str</code></dt>
     <dd>
      <p class="para">
       Il codice PHP che deve essere evidenziato. Questo deve includere il tag di apertura.
      </p>
     </dd>
    
    
     <dt><code class="parameter">return</code></dt>
     <dd>
      <p class="para">
       Settando questo parametro a <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> la funzione ritornerà il
       codice evidenziato.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.highlight-string-returnvalues">
  <h3 class="title">Valori restituiti</h3>
  <p class="para">
   Se <code class="parameter">return</code> è <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>, ritorna il codice
   evidenziato come una stringa al posto di stamparlo. Altrimenti, ritornerà
   <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> in caso di successo o <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> in caso di fallimento.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.highlight-string-changelog">
  <h3 class="title">Log delle modifiche</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Versione</th>
       <th>Descrizione</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>4.2.0</td>
       <td>
        Il parametro <code class="parameter">return</code> è stato aggiunto.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.highlight-string-examples">
  <h3 class="title">Esempi</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Example #1 Esempio di <span class="function"><strong>highlight_string()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />highlight_string</span><span style="color: #007700">(</span><span style="color: #DD0000">'&lt;?php phpinfo(); ?&gt;'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>
     L&#039;esempio sopra stamperà (in PHP 4):
    </p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">&lt;code&gt;&lt;font color=&quot;#000000&quot;&gt;
&lt;font color=&quot;#0000BB&quot;&gt;&amp;lt;?php phpinfo&lt;/font&gt;&lt;font color=&quot;#007700&quot;&gt;(); &lt;/font&gt;&lt;font color=&quot;#0000BB&quot;&gt;?&amp;gt;&lt;/font&gt;
&lt;/font&gt;
&lt;/code&gt;</pre>
</div>
    </div>
    <div class="example-contents"><p>
     L&#039;esempio sopra stamperà (in PHP 5):
    </p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;
&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php phpinfo&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(); &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;
&lt;/span&gt;
&lt;/code&gt;</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.highlight-string-notes">
  <h3 class="title">Note</h3>
  <blockquote class="note"><p><strong class="note">Nota</strong>: <p class="para">Quando il parametro <code class="parameter">return</code>
è utilizzato, questa funzione usa un buffering di output interno, quindi non può essere usata all&#039;interno di una
funzione callback <span class="function"><a href="function.ob-start.php" class="function">ob_start()</a></span>.</p></p></blockquote>
  <p class="para">
   Il markup HTML può essere soggetto a cambiamenti.
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.highlight-string-seealso">
  <h3 class="title">Vedere anche:</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.highlight-file.php" class="function" rel="rdfs-seeAlso">highlight_file()</a> - Evidenziatore di sintassi per un file</span></li>
    <li><a href="misc.configuration.php#ini.syntax-highlighting" class="link">Evidenziare direttive INI</a></li>
   </ul>
  </p>
 </div>


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