Checking for Similar Names : similar_text « String « PHP






Checking for Similar Names

 
<?php
$names = array('A', 'B','R', 'R');

$output = '';
foreach ($names as $name) {
    similar_text($name, 'Roberto Smyth', $percent);
    $output .= "{$name} = {$percent}%\n";
}

echo "<pre>{$output}</pre>";
?>
  
  








Related examples in the same category

1.Determine the similarity between two strings is provided by the similar_text function