Reputation: 3501
Simply put, how do you find out if the 'the' is present in the following string: 'Well lately THEre seems to be much confusion between how to use THEy're, THEre, and THEir, I don't see what THE big deal is?'
The needle capitalized for exaggeration, just trying to figure out how to return the word the is found in the string, but if the string were filled with theres, they'res, and theirs, it wouldn't find it.
Thanks
Upvotes: 1
Views: 186
Reputation: 1034
What about
/* if(stristr($haystack, 'the')){
// do something
} */
doh didn't read the question closely enough.
Upvotes: 0
Reputation: 799510
Do a regex search for /\bthe\b/
.
preg_match('/\bthe\b/', $text)
Upvotes: 7