<?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.stristr.php',
    1 => 'stristr',
    2 => 'Versione insensibile alle maiuscole/minuscole di strstr',
  ),
  'up' => 
  array (
    0 => 'ref.strings.php',
    1 => 'String Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.stripslashes.php',
    1 => 'stripslashes',
  ),
  'next' => 
  array (
    0 => 'function.strlen.php',
    1 => 'strlen',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'it',
    'path' => 'reference/strings/functions/stristr.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.stristr" class="refentry">
   <div class="refnamediv">
    <h1 class="refname">stristr</h1>
    <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">stristr</span> &mdash; <span class="dc-title">
     Versione insensibile alle maiuscole/minuscole di <span class="function"><a href="function.strstr.php" class="function">strstr()</a></span>
    </span></p>

   </div>
   <div class="refsect1 unknown-1399" id="refsect1-function.stristr-unknown-1399">
    <h3 class="title">Descrizione</h3>
     <div class="methodsynopsis dc-description">
      <span class="methodname"><strong>stristr</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">
     Restituisce il contenuto di <code class="parameter">haystack</code> dalla prima occorrenza
     di <code class="parameter">needle</code> fino alla fine.
     <code class="parameter">needle</code> e <code class="parameter">haystack</code>
     sono esaminati senza distinguere tra lettere maiuscole e minuscole.
    </p>
    <p class="para">
     Se <code class="parameter">needle</code> non viene trovato, la funzione restituisce <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>.
    </p>
    <p class="para">
     Se <code class="parameter">needle</code> non è una stringa, viene convertito in 
     un intero e si utilizza il valore ordinale del carattere.
    </p>
    <p class="para">
     <div class="example" id="example-1">
      <p><strong>Example #1 Esempio di uso di <span class="function"><strong>stristr()</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 />  $email </span><span style="color: #007700">= </span><span style="color: #DD0000">'USER@EXAMPLE.com'</span><span style="color: #007700">;<br />  echo </span><span style="color: #0000BB">stristr</span><span style="color: #007700">(</span><span style="color: #0000BB">$email</span><span style="color: #007700">, </span><span style="color: #DD0000">'e'</span><span style="color: #007700">);<br /></span><span style="color: #FF8000">// outputs ER@EXAMPLE.com<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
      </div>

     </div>
    </p>
    <p class="para">
     <div class="example" id="example-2">
      <p><strong>Example #2 Verifica se una stringa esiste o meno</strong></p>
      <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />  $string </span><span style="color: #007700">= </span><span style="color: #DD0000">'Hello World!'</span><span style="color: #007700">;<br />  if(</span><span style="color: #0000BB">stristr</span><span style="color: #007700">(</span><span style="color: #0000BB">$string</span><span style="color: #007700">, </span><span style="color: #DD0000">'earth'</span><span style="color: #007700">) === </span><span style="color: #0000BB">FALSE</span><span style="color: #007700">) {<br />    echo </span><span style="color: #DD0000">'"earth" not found in string'</span><span style="color: #007700">;<br />  }<br /></span><span style="color: #FF8000">// outputs: "earth" not found in string<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
      </div>

     </div>
    </p>
    <p class="para">
     <div class="example" id="example-3">
      <p><strong>Example #3 Utilizzo di un dato non stringa da cercare</strong></p>
      <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />  $string </span><span style="color: #007700">= </span><span style="color: #DD0000">'APPLE'</span><span style="color: #007700">;<br />  echo </span><span style="color: #0000BB">stristr</span><span style="color: #007700">(</span><span style="color: #0000BB">$string</span><span style="color: #007700">, </span><span style="color: #0000BB">97</span><span style="color: #007700">); </span><span style="color: #FF8000">// 97 = lowercase a<br />// outputs: APPLE<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
      </div>

     </div> 
    </p>

    <blockquote class="note"><p><strong class="note">Nota</strong>: <span class="simpara">Questa funzione è
 binary-safe (gestisce correttamente i file binari)</span></p></blockquote>

    <p class="para">
     Vedere anche
     <span class="function"><a href="function.strstr.php" class="function">strstr()</a></span>,
     <span class="function"><a href="function.strrchr.php" class="function">strrchr()</a></span>, 
     <span class="function"><a href="function.substr.php" class="function">substr()</a></span> e
     <span class="function"><strong>ereg()</strong></span>.
    </p>
   </div>

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