$test); parse_str(http_build_query($foo), $output); print_r($output); /* gives: Array ( [param] => some \\\' thing ) */ $foo = array("param" => addslashes($test)); parse_str(http_build_query($foo), $output); print_r($output); /* gives: Array ( [param] => some \\\\\\\' thing ) */ ?>