Home > php教程 > php手册 > php正则取值放入数组求解

php正则取值放入数组求解

WBOY
Release: 2016-06-06 19:42:32
Original
1159 people have browsed it

这是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);

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template