I saw this topic And I have used this code:
$arr = array("hello", "try", "hel", "hey hello");
$search = "hey"; //your search var
for ($i=0; $i<count($arr); $i++) {
$temp_arr[$i] = levenshtein($search, $arr[$i]);
}
asort($temp_arr);
foreach ($temp_arr as $k => $v) {
$sorted_arr[] = $arr[$k];
}
But now I want to search by array in array. For example, if I have this array:
$test = array(
0 => array("google", "http://www.google.com"),
1 => array("test", "http://www.test.com"),
2 => array("test2", "http://www.test2.com")
)
So I want resort by $test[$x][0]
( $x = num
), How can I do that?