<?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.rtrim.php',
    1 => 'rtrim',
    2 => 'Rimuove gli spazi (ed altri caratteri) dalla fine della stringa',
  ),
  'up' => 
  array (
    0 => 'ref.strings.php',
    1 => 'String Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.quotemeta.php',
    1 => 'quotemeta',
  ),
  'next' => 
  array (
    0 => 'function.setlocale.php',
    1 => 'setlocale',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'it',
    'path' => 'reference/strings/functions/rtrim.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.rtrim" class="refentry">
   <div class="refnamediv">
    <h1 class="refname">rtrim</h1>
    <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">rtrim</span> &mdash; <span class="dc-title">
     Rimuove gli spazi (ed altri caratteri) dalla fine della stringa
    </span></p>

   </div>
   <div class="refsect1 unknown-1339" id="refsect1-function.rtrim-unknown-1339">
    <h3 class="title">Descrizione</h3>
     <div class="methodsynopsis dc-description">
      <span class="methodname"><strong>rtrim</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.string.php" class="type string">string</a></span> <code class="parameter">$charlist</code><span class="initializer"> = ?</span></span>): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>

    <blockquote class="note"><p><strong class="note">Nota</strong>: 
     <span class="simpara">
       Il secondo parametro è stato aggiunto nella versione 4.1.0 di PHP.
     </span>
    </p></blockquote>
    <p class="para">
     Questa funzione restituisce la stringa <code class="parameter">str</code> a cui sono stati rimossi gli spazi
     finali.
     Senza la specifica del secondo parametro
     <span class="function"><strong>rtrim()</strong></span> rimuoverà i seguenti caratteri:
     
     <ul class="itemizedlist">
      <li class="listitem">
       <span class="simpara">
        &quot; &quot; (<abbr title="American Standard Code for Information Interchange">ASCII</abbr> <code class="literal">32</code> 
        (<code class="literal">0x20</code>)), spazio ordinario.
       </span>
      </li>
      <li class="listitem">
       <span class="simpara">
        &quot;\t&quot; (<abbr title="American Standard Code for Information Interchange">ASCII</abbr> <code class="literal">9</code> 
        (<code class="literal">0x09</code>)), tab.
       </span>
      </li>
      <li class="listitem">
       <span class="simpara">
        &quot;\n&quot; (<abbr title="American Standard Code for Information Interchange">ASCII</abbr> <code class="literal">10</code> 
        (<code class="literal">0x0A</code>)),  newline (line feed).
       </span>
      </li>
      <li class="listitem">
       <span class="simpara">
        &quot;\r&quot; (<abbr title="American Standard Code for Information Interchange">ASCII</abbr> <code class="literal">13</code> 
        (<code class="literal">0x0D</code>)), carriage return.
       </span>
      </li>
      <li class="listitem">
       <span class="simpara">
        &quot;\0&quot; (<abbr title="American Standard Code for Information Interchange">ASCII</abbr> <code class="literal">0</code> 
        (<code class="literal">0x00</code>)), il byte <code class="literal">NUL</code>.
       </span>
      </li>
      <li class="listitem">
       <span class="simpara"> 
        &quot;\x0B&quot; (<abbr title="American Standard Code for Information Interchange">ASCII</abbr> <code class="literal">11</code> 
        (<code class="literal">0x0B</code>)), il tab verticale.
       </span>
      </li>
     </ul>
    </p>
    <p class="para">
     Si può anche specificare i caratteri che si desidera rimuovere, indicandoli
     nel parametro <code class="parameter">charlist</code>.
     Quest&#039;ultimo è costituito da un semplice elenco di caratteri da rimuovere. Con
     <code class="literal">..</code> si può specificare un range di caratteri.
    </p>
    <div class="example" id="example-1">
     <p><strong>Example #1 Esempio di uso di <span class="function"><strong>rtrim()</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 /><br />$text </span><span style="color: #007700">= </span><span style="color: #DD0000">"\t\tThese are a few words :) ...  "</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$trimmed </span><span style="color: #007700">= </span><span style="color: #0000BB">rtrim</span><span style="color: #007700">(</span><span style="color: #0000BB">$text</span><span style="color: #007700">);<br /></span><span style="color: #FF8000">// $trimmed = "\t\tThese are a few words :) ..."<br /></span><span style="color: #0000BB">$trimmed </span><span style="color: #007700">= </span><span style="color: #0000BB">rtrim</span><span style="color: #007700">(</span><span style="color: #0000BB">$text</span><span style="color: #007700">, </span><span style="color: #DD0000">" \t."</span><span style="color: #007700">);<br /></span><span style="color: #FF8000">// $trimmed = "\t\tThese are a few words :)"<br /></span><span style="color: #0000BB">$clean </span><span style="color: #007700">= </span><span style="color: #0000BB">rtrim</span><span style="color: #007700">(</span><span style="color: #0000BB">$binary</span><span style="color: #007700">, </span><span style="color: #DD0000">"\x00..\x1F"</span><span style="color: #007700">);<br /></span><span style="color: #FF8000">// rimuove i caratteri di controllo ASCII dalla fine di $binary <br />// (from 0 to 31 inclusive)<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
     </div>

    </div>
    <p class="para">
     Vedere anche <span class="function"><a href="function.trim.php" class="function">trim()</a></span> e <span class="function"><a href="function.ltrim.php" class="function">ltrim()</a></span>.
    </p>
   </div>

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