Removing a value from an array
Posted: Mon Nov 14, 2005 5:16 am
Hi all
I have built my own search engine to search my site for resources.
It takes the search terms from the text box and then breaks the phrase into its individual words which I then search on and base relevancy upon.
the problem is it takes all words including common words such as "and", "a" etc.
what I would like to do is remove these type of words if they arise.
How would i go about removing these from the array before I pass it onto my listing function??
thanks in advance
I have built my own search engine to search my site for resources.
It takes the search terms from the text box and then breaks the phrase into its individual words which I then search on and base relevancy upon.
Code: Select all
$q_array=explode(" ", $q);
//count how many keywords there are
$q_num=(integer)count($q_array);
$r = query_table($q_num, $q_array, $cat);what I would like to do is remove these type of words if they arise.
How would i go about removing these from the array before I pass it onto my listing function??
thanks in advance