At the minute I have a page with an AJAX script that searches a database with LIKE ‘%search term from input box%’.
I need to modify it so that instead of searching the database it searches an array (that has been constructed from two tables – I can’t use a JOIN because there’s a bit more to it than that).
How do I go about creating a fuzzy search function in PHP that will return all the possible matches from the array?
you want preg_grep
e.g.
$resultswill now contain two elements,"tom jones"and"bob jones"