$datetime = "2016-04-13T11:18:38+08:00";
$code =200;
$goodslist = array(
array("app"=>"app1","id"=>"1"),
array("app"=>"app2","id"=>"2"),
array("app"=>"app3","id"=>"3"),
);
$content = array(
"datetime" => $datetime,
"code" => $code,
"goodslist" => $goodslist,
);
$YC = json_encode($content,TRUE);
echo var_dump($YC);
$datas = json_decode($YC);
echo var_dump($datas);
$arr=json_decode($YC,true);
$arr2=array();
foreach($arr['goodslist'] as $val){
$arr2[]=array("app"=>$val['app'],"id"=>$val['id']);
}
echo "<pre>";
print_r($arr2);
echo "</pre>";
运行后的效果图: