HELP! how to remove / in apostrophe

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
buknoii
Forum Newbie
Posts: 4
Joined: Fri Mar 14, 2008 5:49 am

HELP! how to remove / in apostrophe

Post by buknoii »

hi there! i want to ask if someone in here got an idea on how to remove the \ in apostrophes?

because everytime i access content in my database and if it has ' it also displays \

for example cricket\'s should be crickets
User avatar
Syntac
Forum Contributor
Posts: 327
Joined: Sun Sep 14, 2008 7:59 pm

Re: HELP! how to remove / in apostrophe

Post by Syntac »

Use stripslashes(). Or put this at the top of your script (this is the method I recommend):

Code: Select all

set_magic_quotes_runtime( 0 );
You can also mess around with your php.ini file and set everything related to magic_quotes to off.
Post Reply