PHP Classes

File: example

Recommend this page to a friend!
  Classes of Marius Ciotlos   String Similarity   example   Download  
File: example
Role: Example script
Content type: text/plain
Description: example file
Class: String Similarity
Calculate the similarity of two text strings
Author: By
Last change:
Date: 17 years ago
Size: 370 bytes
 

Contents

Class file image Download
<?php

include("StringMatch.php");

$string1 = "this should be same the";
$string2 = "this should be the same";
$length1 = strlen($string1);
$length2 = strlen($string2);
$limit = 0.4;
$comparison = new StringMatch;
$result = $comparison->fstrcmp ($string1, $length1, $string2, $length2, $limit);

echo
"Strings match around: ".round(($result*100),2)."%";
?>