Why backslashes are added into json data when parse_str
is used? For instance,
# Get the query string.
$string_query = 'type={"page":"page"}';
# Parse the string into an array &array_query.
parse_str($string_query, $array_query);
var_dump($array_query);
result in my localhost (which is the data I am after),
array
'type' => string '{"page":"page"}' (length=15)
but in the live server,
array(1) { ["type"]=> string(19) "{\"page\":\"page\"}" }
How can I not to add the backslashes into json data?