1 단어를 여러 단어와 비교하는 형태로 levenshtein 점수 목록을 출력합니다. 그들은 순서대로 나열 그래서 그 점수를 얻을 수있는 방법, 작은 levenshtein 점수 1 :리스트에있는 순서대로 Levenshtein 점수를 나열하십시오.
<?php
$string5 = $_POST["singleword"];
$string6 = $_POST["manywords"];
$array6 = explode(', ',$string6);
foreach ($array6 as $derp)
{
echo $string5, "/", $derp, ": ", levenshtein($string5, $derp), "<br>";
}
?>
같은 것 출력 목록 :
apple/mango: 5
apple/peach: 5
apple/toothpaste: 8
apple/apes: 3
내가 이렇게 할 것을 권장합니다
apple/apes: 3
apple/mango: 5
apple/peach: 5
apple/toothpaste: 8
나는 그것이 arsort와 관련이 있다는 것을 알고 있지만 사용법을 알 수는 없다. – user1721230