excuse me i forgotten to describe.
This function automated add Slashes to a string because of the document.write() function in Javascript. But i avoid this problem in Java thanks any way.
But i want to know if there is any function doing like that.
$string = "Hello// this is a string\\?"
$string = addslashes($string);
that is now in $string
"Hello \/ this is a string \\?"
It just goes through a string and escapes a few specific characters (' " \ NULL) to make it database-friendly. I think there's DBI quote functions I've seen mentioned before, but it could be done with a regular expression, too.
$string =~ s/("|'|\\|\x00)/\\$1/g; ----------------------------------------------------------------------------------
...but I'm just a C man trying to see the light
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.