复制代码 代码如下:
$first = "abcdefg";
$second = "aeg";
echo similar_text($first, $second);结果输出3.如果想以百分比显示,则可使用它的第三个参数,如下:
$first = "abcdefg";
$second = "aeg";
similar_text($first, $second, $percent);
echo $percent;
复制代码 代码如下:
<?php
echo levenshtein("Hello World","ello World");
echo "<br />";
echo levenshtein("Hello World","ello World",10,20,30);
?>
新闻热点
疑难解答