php - How extract information using json from api -


i have api :

{"id":[{"name":"tuos","tier":"v","queue":"solo"}]} 

and need extract "tier" value it, got code :

$result = file_get_contents('url link here'); $tier = json_decode($result); echo $tier->id->tier; 

what need correct in code ? , wrong ?

that value in array (id array noted bracket syntax):

echo $tier->id[0]->tier; 

Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -