Get value from a JSON with PHP -


how can value of name in infos ?

{     "infos": {         "name": "marc twain"     },     "datas": [         {...}     ] } 

do need foreach ?

what tried without success:

$json = json_decode($file); $json->infos[0]->name 

could me?

infos not array, do:

$json->infos->name 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -