I have a curl request which returns a json string. The results looks like, and can have any value of escaped hex unicodes:
{ "title" : "20\x2f20" }//curl result example
I have tried everything to decode this results escaped unicode into its ascii character. I ultimately want to convert to a valid json object:
{ "title" : "20/20" }
However nothing seems to work...
$foo='{ "title" : "20\x2f20" }';
$foobar = addcslashes($foo, '"');
echo htmlentities($foobar,NULL,'UTF-8');
echo htmlentities($foo);
echo json_encode($foo);
echo json_encode($foo,JSON_UNESCAPED_SLASHES);
echo json_encode($foo,JSON_UNESCAPED_UNICODE);
//none of the above produces the desired result: { "title" : "20/20" }
Any help would be appreciated.