php截取字符串问题

WBOY
Release: 2016-06-20 12:46:14
Original
949 people have browsed it

"UID": 0, "RID": 0, "Name": "张三", "Sex": "女", "Age": 30,"mobile": "10000", "Job": "公司职员","remark": "很好",
 "ImgList": "a.jpg,b.jpg",   "Time": 1000000    怎么实现把他变成数组 的形式 以:前面为键名后面为键值 调用时可以直接


回复讨论(解决方案)

$str = '"UID": 0, "RID": 0, "Name": "张三", "Sex": "女", "Age": 30,"mobile": "10000", "Job": "公司职员","remark": "很好", "ImgList": "a.jpg,b.jpg",   "Time": 1000000';$str = '{'.$str.'}';$data = json_decode($str, true);echo $data['Name'].'<br>';print_r($data);
Copy after login

"UID": 0, "RID": 0, "Name": "张三", "Sex": "女", "Age": 30,"mobile": "10000", "Job": "公司职员","remark": "很好",
 "ImgList": "a.jpg,b.jpg",   "Time": 1000000    怎么实现把他变成数组 的形式 以:前面为键名后面为键值 调用时可以直接


谢谢大神!真是太及时了!!!万分感谢!!
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template