- array_map: documentation ( source)
- stripslashes: documentation ( source)
- http_build_query: documentation ( source)
<?php
function stripcslashes_map($val)
{
if (is_array($val)) {
$val = array_map(__FUNCTION__, $val);
} else {
$val = stripslashes($val);
}
return $val;
}
$x=array('name'=>"\'qwert\'");
$httpQuery=http_build_query(array_map('stripcslashes_map', $x));
echo httpQuery;