PLs help..Searching a single quote In a string

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
anirbanb2004
Forum Newbie
Posts: 23
Joined: Sun Oct 15, 2006 4:21 pm

PLs help..Searching a single quote In a string

Post 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..
mentor
Forum Contributor
Posts: 100
Joined: Sun Mar 11, 2007 11:10 am
Location: Pakistan

Post by mentor »

Use strpos().
anirbanb2004
Forum Newbie
Posts: 23
Joined: Sun Oct 15, 2006 4:21 pm

Post by anirbanb2004 »

Please explain how to use it to find single quote...
strpos("String To search in","string to start");
Now how to use???
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Have you looked at the manual for strpos? It clearly shows how to use the function, along with many examples.
Post Reply