feiyuanqiu
2015-04-09 21:15:29 +08:00
需要先转成数组或对象处理之后再转回来吧?直接出结果的函数好像没有
$from = '{"status": "success","total": 1,"data": [{"id": 1,"type": 0,"logo": "1428470471LLnfH.jpg","name": "123","profile": "","city": "","address": "","location": "","email": "comapny@company.com","phone": "123456","website": "","weibo": "","service": "","tags": "","user_count": 3,"thumb_logo": "http://120.25.210.83/upload/companies/thumb/1428470471LLnfH.jpg"}]}';
$from = json_decode($from, true);
array_walk($from['data'], function (&$item) {
$picks = array(
'id' => '',
'logo' => '',
'name' => '',
'email' => '',
'phone' => '',
'tags' => '',
'user_count' => '',
'thumb_logo' => '',
);
$item = array_intersect_key($item, $picks);
});
$from = json_encode($from);