addslashes
Returns a string with backslashes before single quotes double quotes backslashes and NUL
[...] = optional ... = your value
[var $... = ]call addslashes $val=...
Example code
<!--parser:xtscript-->
var $input = FO'OBA"R"
var $output = call addslashes $val=$input
print input = $input<br />
print output = $output
<!--/parser:xtscript-->
Show in textareaExample output
Reloadinput = FO'OBA"R"
output = FO\'OBA\"R\"