Home  >  Article  >  Backend Development  >  PHP parsing JSON data_PHP tutorial

PHP parsing JSON data_PHP tutorial

WBOY
WBOYOriginal
2016-07-20 11:10:16841browse

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...
Statement:
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