Reputation: 1215
Simple question. I have a program that uses AJAX to send data from an HTML form to a PHP script that creates a PDF. If a user inputs a value on the HTML form that has an apostrophe it's encoded/escaped with a backslash. For instance, 'Joe's' becomes 'Joe\s'
How can remove the backslash? I suppose I could use str_replace('\', '', $input) but I'm wondering what a broader approach to 'unescaping' a string is in PHP.
Upvotes: 0
Views: 103
Reputation: 943510
Normal use of Ajax will not add slash characters to data.
The most likely source of them is magic quotes (which are evil). Turn them off.
Upvotes: 3