PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
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.
/* Return the word matches in question which ARENT in omitted words */
$validWords = array();
$validWords = array_diff($questionWords, $omittedWords);
return $validWords;
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.
i.e. For the above code sizeof($validWords) would equal 3 if there are three words, but the id's of the words might not be 0, 1, 2 as the for loop would check. Hence my problem.