Código PHP:
<?php
function escape_quotes($receive) {
if (!is_array($receive))
$thearray = array($receive);
else
$thearray = $receive;
foreach (array_keys($thearray) as $string) {
$thearray[$string] = addslashes($thearray[$string]);
$thearray[$string] = preg_replace("/[\\/]+/","/",$thearray[$string]);
}
if (!is_array($receive))
return $thearray[0];
else
return $thearray;
}
?>