Reputation: 125
I have a textarea where the user inputs text for a post. I then display the data on the site. How can I prevent the rendering of apostrophes with backslashes in the result? For example:
"Let's do this"
would be:
"Let'\s do this"
Upvotes: 0
Views: 1540
Reputation: 21
You may be able to use the function stripslashes()
.
However, disabling magic quotes and escaping the input would also be prudent.
Upvotes: 2
Reputation: 11
Yep, disable magicquotes or strip slashes.
You'll also want to strip tags. Your website will be vulnerable to attacks if you don't.
Upvotes: 0