Skip to content

Instantly share code, notes, and snippets.

@aoeuidht
Created May 6, 2014 09:10
Show Gist options
  • Select an option

  • Save aoeuidht/358bb1ea8ccc7118d5a8 to your computer and use it in GitHub Desktop.

Select an option

Save aoeuidht/358bb1ea8ccc7118d5a8 to your computer and use it in GitHub Desktop.
$json = '{"content":[{"panoinfo":[],"poiinfo":{"Catalog":"010505","Dir":358,"IID":"b3d914ba8452438b8505bf08","PID":"0100220000130808102448157J5","PanoX":12957303,"PanoY":4827896,"Pitch":-2,"Rank":935,"Time":"2013","Timeline":[],"UID":"49d959381b59a043c61e5102","X":12957233,"Y":4828356,"Zoom":"1.31","bus":"","hasinter":1,"hasstreet":1,"importance":0,"ismodified":1,"name":"\u5317\u6d77\u516c\u56ed","std_tag":"\u65c5\u6e38\u666f\u70b9;\u516c\u56ed","StartID":"0400220000130924115253753IN"}}],"result":{"error":0}}';
$json = str_replace(""", "hack_quot", $json);
$json = html_entity_decode(preg_replace('/\\\\u([a-z0-9]{4})/i', '&#x$1;', $json),ENT_QUOTES, 'UTF-8');
$json = str_replace("hack_quot", """, $json);
echo $json;
echo "\n";
$d = array();
$d['array'] = array();
$d['obj'] = (object)array();
echo json_encode($d);
echo "\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment