<?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.nl2br.php',
    1 => 'nl2br',
    2 => 'Inserisce il tag HTML di \'a capo\' prima di tutti i caratteri di \'a capo\' della stringa',
  ),
  'up' => 
  array (
    0 => 'ref.strings.php',
    1 => 'String Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.nl-langinfo.php',
    1 => 'nl_langinfo',
  ),
  'next' => 
  array (
    0 => 'function.number-format.php',
    1 => 'number_format',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'it',
    'path' => 'reference/strings/functions/nl2br.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.nl2br" class="refentry">
   <div class="refnamediv">
    <h1 class="refname">nl2br</h1>
    <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">nl2br</span> &mdash; <span class="dc-title">
     Inserisce il tag HTML di &#039;a capo&#039; prima di tutti i caratteri di &#039;a capo&#039; della stringa
    </span></p>

   </div>
   <div class="refsect1 unknown-1321" id="refsect1-function.nl2br-unknown-1321">
    <h3 class="title">Descrizione</h3>
     <div class="methodsynopsis dc-description">
      <span class="methodname"><strong>nl2br</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$string</code></span>): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>

    <p class="para rdfs-comment">
     Restituisce la stringa <code class="parameter">string</code> con &#039;&lt;br /&gt;&#039; inserito
     prima di tutti i newline.
    </p>
   <blockquote class="note"><p><strong class="note">Nota</strong>: 
    <p class="para">
     A partire dal PHP 4.0.5, <span class="function"><strong>nl2br()</strong></span> è conforme a XHTML.
     Tutte le versioni precedenti alla 4.0.5 restituiscono la
     <code class="parameter">string</code> con &#039;&lt;br&gt;&#039; invece di &#039;&lt;br /&gt;&#039; inserito prima
     degli &#039;a capo&#039;.     
    </p>
   </p></blockquote>
    <p class="para">
     <div class="example" id="example-1">
      <p><strong>Example #1 Esempio di uso di  <span class="function"><strong>nl2br()</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 /></span><span style="color: #007700">echo </span><span style="color: #0000BB">nl2br</span><span style="color: #007700">(</span><span style="color: #DD0000">"foo isn't\n bar"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
      </div>

      <div class="example-contents"><p>
       this will output :
      </p></div>
      <div class="example-contents screen">
<div class="annotation-interactive cdata"><pre>
foo isn&#039;t&lt;br /&gt;
 bar
</pre></div>
      </div>
     </div>
    </p>
    <p class="para">
     Vedere anche <span class="function"><a href="function.htmlspecialchars.php" class="function">htmlspecialchars()</a></span>,
     <span class="function"><a href="function.htmlentities.php" class="function">htmlentities()</a></span>, 
     <span class="function"><a href="function.wordwrap.php" class="function">wordwrap()</a></span> e
     <span class="function"><a href="function.str-replace.php" class="function">str_replace()</a></span>.
    </p>
   </div>

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