I'm developing a search engine for my site, but have come accross a problem. Currently a search string is supplied by the user, the string 'strg' is sent via the GET method. Once recieved the PHP uses the explode() function:
$search = explode(" ", $HTTP_GET_VARS["strg"]);
Then counts the words. From the new array and counted number of words it then creates the necessary SQL statement.
However if the search string inlcuded a double space there will be values in the array equivalent to null, and as a result all of the entries from the database are given! Is there an easy way to remove these?