Click to See Complete Forum and Search --> : How to perform this ??


PHPycho
06-28-2007, 08:08 AM
Hello forums !!
case:
Suppose i had the following var
var text = "This is my text with 'quotes'";
I want to replace the ' -> \' using some function like replace()
How to perform this ?
Thanks in advance to all of you

rincewind456
06-28-2007, 11:27 AM
addslashes()

dougal85
06-28-2007, 04:04 PM
addslashes()

I think he means in Javascript. Try something like; http://javascript.about.com/library/bladdslash.htm

JPnyc
06-28-2007, 05:16 PM
this.value.replace(/\\/g,'')

something like that