开发者

PHP regular expression to behave like mysql match

开发者 https://www.devze.com 2023-03-09 23:28 出处:网络
I need a PHP regular expression that will compare stings similar to mysql Match Against开发者_开发知识库 behaviour.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消