<?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.similar-text.php',
    1 => 'similar_text',
    2 => 'Calcola la similitudine tra due stringhe',
  ),
  'up' => 
  array (
    0 => 'ref.strings.php',
    1 => 'String Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.sha1-file.php',
    1 => 'sha1_file',
  ),
  'next' => 
  array (
    0 => 'function.soundex.php',
    1 => 'soundex',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'it',
    'path' => 'reference/strings/functions/similar-text.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.similar-text" class="refentry">
   <div class="refnamediv">
    <h1 class="refname">similar_text</h1>
    <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">similar_text</span> &mdash; <span class="dc-title">
     Calcola la similitudine tra due stringhe
    </span></p>

   </div>
   <div class="refsect1 unknown-1345" id="refsect1-function.similar-text-unknown-1345">
    <h3 class="title">Descrizione</h3>
     <div class="methodsynopsis dc-description">
      <span class="methodname"><strong>similar_text</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$first</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$second</code></span>, <span class="methodparam"><span class="type"><a href="language.types.float.php" class="type float">float</a></span> <code class="parameter reference">&$percent</code><span class="initializer"> = ?</span></span>): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>

    <p class="para rdfs-comment">
     Questa funzione calcola la similitudine tra due stringhe come descritto
     in Oliver [1993]. Attenzione che questa implementazione non utilizza
     lo stack come nel psuedo codice di Oliver, ma utilizza chiamate ricorsive che possono
     o non possono velocizzare l&#039;intero processo. Occorre anche rilevare che la 
     complessità di questo algoritmo è O(N**3) dove N è la lunghezza della
     stringa più lunga.
    </p>
    <p class="para">
     Passando per riferimento il terzo argomento,
     <span class="function"><strong>similar_text()</strong></span> la funzione calcolerà la similitudine
     in percentuale. La funzione restituisce il numero di caratteri corrispondenti in entrambe
     le stringhe.
    </p>
    <p class="simpara">
     Vedere anche <span class="function"><a href="function.levenshtein.php" class="function">levenshtein()</a></span> e <span class="function"><a href="function.soundex.php" class="function">soundex()</a></span>.
    </p>
   </div>

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