<?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.strrchr.php',
    1 => 'strrchr',
    2 => 'Trova l\'ultima occorrenza di un carattere in una stringa',
  ),
  'up' => 
  array (
    0 => 'ref.strings.php',
    1 => 'String Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.strpos.php',
    1 => 'strpos',
  ),
  'next' => 
  array (
    0 => 'function.strrev.php',
    1 => 'strrev',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'it',
    'path' => 'reference/strings/functions/strrchr.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.strrchr" class="refentry">
   <div class="refnamediv">
    <h1 class="refname">strrchr</h1>
    <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">strrchr</span> &mdash; <span class="dc-title">
     Trova l&#039;ultima occorrenza di un carattere in una stringa
    </span></p>

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

    <p class="para rdfs-comment">
     Questa funzione restituisce la porzione di
     <code class="parameter">haystack</code> che inizia dall&#039;ultima occorrenza di
     <code class="parameter">needle</code> e finisce al termine di
     <code class="parameter">haystack</code>.
    </p>
    <p class="para">
     Restituisce <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> se <code class="parameter">needle</code> non viene trovato.
    </p>
    <p class="para">
     Se <code class="parameter">needle</code> contiene più di un
     carattere, in PHP 4 si utilizza solo il primo. Questo comportamento è differente rispetto
     a <span class="function"><a href="function.strchr.php" class="function">strchr()</a></span>.
    </p>
    <p class="para">
      Se <code class="parameter">needle</code> non è una stringa, viene convertito
     in un intero e utilizzato come valore ordinale di un carattere.
     <div class="example" id="example-1">
      <p><strong>Example #1 Esempio di uso di <span class="function"><strong>strrchr()</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: #FF8000">// L'ultima directory in $PATH<br /></span><span style="color: #0000BB">$dir </span><span style="color: #007700">= </span><span style="color: #0000BB">substr</span><span style="color: #007700">(</span><span style="color: #0000BB">strrchr</span><span style="color: #007700">(</span><span style="color: #0000BB">$PATH</span><span style="color: #007700">, </span><span style="color: #DD0000">":"</span><span style="color: #007700">), </span><span style="color: #0000BB">1</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// ottiene qualsiasi cosa dopo l'ultimo newline<br /></span><span style="color: #0000BB">$text </span><span style="color: #007700">= </span><span style="color: #DD0000">"Line 1\nLine 2\nLine 3"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$last </span><span style="color: #007700">= </span><span style="color: #0000BB">substr</span><span style="color: #007700">(</span><span style="color: #0000BB">strrchr</span><span style="color: #007700">(</span><span style="color: #0000BB">$text</span><span style="color: #007700">, </span><span style="color: #0000BB">10</span><span style="color: #007700">), </span><span style="color: #0000BB">1 </span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
      </div>

     </div>
    </p>
    <p class="para">
     <span class="function"><strong>strrchr()</strong></span> è affidabile con i dati binari dal PHP 4.3.0
    </p>
    <p class="para">
     Vedere anche <span class="function"><a href="function.strstr.php" class="function">strstr()</a></span>, <span class="function"><a href="function.substr.php" class="function">substr()</a></span> e
     <span class="function"><a href="function.stristr.php" class="function">stristr()</a></span>.
    </p>
   </div>

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