How to compage 2 metaphone results

139 Views Asked by At

I'm wondering if there is an efficient way to compare 2 metaphone results in php.

metaphone 1 = OSKRSWRNNTFYFFTFRHNNSSBSTPKTR

metaphone 2 = FYNTTNWSWRNBTRPRTTLRKTFRHKTTRT0BSTPKTRWNRT0SKR

What would a good start or approach ?

1

There are 1 best solutions below

0
AudioBubble On BEST ANSWER

I tried this :

<?php

$metaphone1 = "OSKRSWRNNTFYFFTFRHNNSSBSTPKTR";
$metaphone2 = "FYNTTNWSWRNBTRPRTTLRKTFRHKTTRT0BSTPKTRWNRT0SKR";
$metaphone3 = "WERTYTRSDVVQQOSKRSWRNNTFYFFTFRHNNSSBSTPKTR";

echo levenshtein($metaphone1,$metaphone2); // Returns 30
echo levenshtein($metaphone2,$metaphone3); // Returns 36


?>