Reputation: 1
I'm looking for a way to find out if a word is somewhere in a set of characters. For example if the word "looking" is in "hereisthewordim*looking*for"
if( strpos("looking", "hereisthewordimlookingfor") !== false) {
echo "true";
}
Upvotes: 0
Views: 82
Reputation: 8178
I think you're looking for this:
if(stristr("hereisthewordimlookingfor","looking")) {
echo "true";
};
Upvotes: 0
Reputation: 12025
You need to replace the parameters:
strpos("hereisthewordimlookingfor", "looking")
Upvotes: 2