array_diff
Posted: Mon Feb 05, 2007 7:40 pm
I have two arrays, one containing omitted words and one containing a search term. I want an array of the search terms minus the omitted words if they exist.
e.g. this is my code:
Both the arrays to be input are definitely containing the correct values, but I only seem to get three values maximum stored in the $validWords array created. Its a very strange problem.
e.g. this is my code:
Code: Select all
/* Return the word matches in question which ARENT in omitted words */
$validWords = array();
$validWords = array_diff($questionWords, $omittedWords);
return $validWords;