php正则取值放入数组求解
程序员文章站
2022-05-15 09:46:00
...
这是json 吗? 用json_decode(); $json_arr= json_decode(你的内容赋值给一个变量,true); $data = array(); foreach($json_arr['listInfo'] as $key=$val) { $data[$key]['nickname'] = $val["nickname"]; $data[$key]['apply_id'] = $val["apply_id"]; } v
这是json 吗? 用json_decode();
$json_arr = json_decode(你的内容赋值给一个变量,true);
$data = array();
foreach($json_arr['listInfo'] as $key=>$val)
{
$data[$key]['nickname'] = $val["nickname"];
$data[$key]['apply_id'] = $val["apply_id"];
}
var_dump($data);
上一篇: php mysql 找欄位中的某字串