public function escapeString($string) { $x = str_replace("\\", "\\\\", $string); return str_replace("\"", "\\\"", $x); }