Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find the match percentage between two strings in php?

can anyone suggest me a better method(or most preferred method) to find the match percentage between two strings(i.e. how closely those two strings(eg. name) are related in terms of percentage) using fuzzy logic.? can anyone help me to write the code? really i am wondering where to start..

like image 723
user1518659 Avatar asked Dec 12 '22 23:12

user1518659


1 Answers

$str1 = 'Hello';
$str2 = 'Hello, World!';
$percent;
similar_text($str1, $str2, $percentage);

http://php.net/manual/en/function.similar-text.php

like image 157
Nick Aversano Avatar answered Jan 19 '23 01:01

Nick Aversano