Home  >  Article  >  Backend Development  >  How to get the value in json in php?

How to get the value in json in php?

WBOY
WBOYOriginal
2016-08-04 09:20:133301browse

{"result":{"songs":[{"id":33916732,"name":"Farewell, love}]},{"songs":[{"id":3654522,"name":"年wheel}]}...

There is such a set of cyclic arrays. How can I get the id value of songs using php? Can you please help me.

Reply content:

{"result":{"songs":[{"id":33916732,"name":"Farewell, love}]},{"songs":[{"id":3654522,"name":"年wheel}]}...

There is such a set of cyclic arrays. How can I get the id value of songs using php? Can you please help me.

Use json_decode() to parse json data, and then use foreach() to loop the output

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