Page 1 of 1

PLs help..Searching a single quote In a string

Posted: Tue Mar 20, 2007 12:46 pm
by anirbanb2004
Hi my problem is to find out existance of a single quote (') in a string.
for example Citta' has one at the last.
Now the searchable string is in $word
I have used strrchr($word,"'");
No error message..but not sure would it work?
Please help..

Posted: Tue Mar 20, 2007 12:49 pm
by mentor
Use strpos().

Posted: Tue Mar 20, 2007 1:11 pm
by anirbanb2004
Please explain how to use it to find single quote...
strpos("String To search in","string to start");
Now how to use???

Posted: Tue Mar 20, 2007 1:56 pm
by John Cartwright
Have you looked at the manual for strpos? It clearly shows how to use the function, along with many examples.