How to sort an array by similarity in relation to an inputted word.

前端 未结 5 936
闹比i
闹比i 2020-12-05 11:21

I have on PHP array, for example:

$arr = array(\"hello\", \"try\", \"hel\", \"hey hello\");

Now I want to do rearrange of the array which w

5条回答
  •  一个人的身影
    2020-12-05 12:01

    Another way is to use similar_text function which returns result in percents. See more http://www.php.net/manual/en/function.similar-text.php .

提交回复
热议问题