user1481563
user1481563

Reputation: 125

Textarea apostrophes becoming backslashes?

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

Answers (3)

Guilherme
Guilherme

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

libra99
libra99

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

Related Questions