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: 15 years ago
Size: 370 bytes


Class file image Download


$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);

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

For more information send a message to info at phpclasses dot org.