PHP regular expression to behave like mysql match
I need a PHP regular expression that will compare stings similar to mysql Match Against开发者_开发知识库 behaviour.
e.g:
string = "findmatches";
$pattern = 'fildcatches';
this pattern is supposed to match the string
Thanks a lot
Regular expression may not be the best solution for your needs, try instead the PHP construct similar_text() :
http://php.net/manual/en/function.similar-text.php
The function returns the similarity between two strings in percentage and the number of matching chars.
精彩评论