mnb93
asked on
stripslashes(PHP) in javascript?
How can I do it?
I don't know PHP - in JavaScript there is an 'unescape' function... Is that what you are after?
ASKER
That's for urls.
I would like http://au.php.net/stripslashes
Returns a string with backslashes stripped off. (\' becomes ' and so on.) Double backslashes (\\) are made into a single backslash (\).
\' \" \n \r \c Really I would just like the \" and \\.
I would like http://au.php.net/stripslashes
Returns a string with backslashes stripped off. (\' becomes ' and so on.) Double backslashes (\\) are made into a single backslash (\).
\' \" \n \r \c Really I would just like the \" and \\.
ASKER
eg. \\\\\\\"\"\\ = \\\""\
You'd have to use a very carefully crafted .replace() regular expression call. A better option, though I'm not sure it would work, would be to use htmlentities() ( http://us3.php.net/manual/en/function.htmlentities.php ) instead of adding slashes to it in the first place. Then the javascript unescape function would probably be able to translate it properly.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.