Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
August 13, 2005, 12:45 am
rate this thread
How do I see if one string is found within another string?
or how many instances of one string, is found within another.
a="Sheree smells of poo"
I'd like a function that would return 1, (for true, or that the word
smells, if found once)
PHP is ace. There must be a simple way of doing this. I mean, its got
loads of useless functions that noones ever going to use. Im sure if
PHP has a built-in function to convert hebrew, then Im sure it can do
this. Any ideas?
Re: How do I see if one string is found within another string?
But be careful of the comparison you do. If the search string is at the
beginning strpos will return 0, naturally. You want anything other than
false so you need to do !==false as the comparison.
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/