I’m trying to use the strpos function to search a text file. I have no problems getting results if I use one word as my search term, but if I use more than one word, I get no results. Is strpos only capable of looking for one word in an array? Is there a better way to do this…. here is the basic code, $search is the array being searched:
$show = $_GET[‘show’];
if ($show==NULL) { $show=”00″;
//there are about 30 lines of code in between these exploding the file, then naming the subvariables in the file and looping through them to display. All items in the file are displayed if nothing is input for show, otherwise only the items with the word=show are displayed.
if ((strpos($search,$show)>=1)) { // Search for words
echo results // results is actually a table with the variable placements
};
This works great if only one word is input for show, but shazbots if more than one word is entered. Suggestions or links to tutorials etc are more than welcome.
Thank you very much!