PHP parsing JSON data_PHP tutorial

WBOY
Release: 2016-07-20 11:10:16
Original
840 people have browsed it

Most popular web services such as twitter provide data through open APIs. It always knows how to parse various transmission formats of API data, including JSON, XML, etc.

 代码如下 复制代码
$json_string='{"id":1,"name":"foo","email":"foo@foobar.com","interest":["wordpress","php"]} ';
$obj=json_decode($json_string);
echo $obj->name;
//prints foo echo $obj->interest[1]; //prints php

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/444737.htmlTechArticleMost popular web services such as twitter provide data through open APIs, it always knows how to parse the API Various data transmission formats, including JSON, XML, etc. Codes such as...
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!