xxxxxxxxxx
json_decode($val, true, JSON_UNESCAPED_SLASHES);
xxxxxxxxxx
<?php
$str = "Is your name O\'reilly?";
// Salida: Is your name O'reilly?
echo stripslashes($str);
?>
xxxxxxxxxx
echo stripslashes('{\"test\":{\"test1\":{\"test1\":[{\"test2\":\"1\",\"test3\": \"foo\",\"test4\":\"bar\",\"test5\":\"test7\"}]}}}');
xxxxxxxxxx
$response = [
'default1' => $default1,
'default2' => $default2
];
header('Content-Type: application/json');
echo json_encode($response);