The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
I've had a look at PHP.net for some decent string search functions, but the best I could muster was a comparison that took the whole search term and compared it to another string. So I know that I either need to find a way of breaking down an inputted string by spaces, then comparing each individual word, or does PHP have a search function already, and I'm such a joey that I can't find it?
You have until I get back from the toilet, run my minions, run!
Cheers Garin, I'll give that a go. Didn't see "preg" on the php.net site, but I'll look it up.
$search="word1 word2 word3";
// Convert the string into a regular expression
$newsearch= preg_replace("/\s+/","|",trim($search));
// sets newsearch to "word1|word2|word3"
if (preg_match("/$newsearch/","word2 is in this text")) {
echo "match found";
}
Regular expressions are a whole topic in themselves though, so maybe you'd feel more comfortable just breaking up the string
I've had a look at PHP.net for some decent string search functions, but the best I could muster was a comparison that took the whole search term and compared it to another string. So I know that I either need to find a way of breaking down an inputted string by spaces, then comparing each individual word, or does PHP have a search function already, and I'm such a joey that I can't find it?
You have until I get back from the toilet, run my minions, run!