Quantcast
Channel: Using a JSON feed with PHP - Stack Overflow
Viewing all articles
Browse latest Browse all 4

Using a JSON feed with PHP

$
0
0

I Have a problem for using a json feed with php.For example :

[{"type":"article","article":[{"title":"hello","number":{"facebook":4,"twitter":6}}],[{"type":"article","article":[{"title":"hello","number":{"facebook":1,"twitter":3}}],

I have no problem to save the title :

$titre = $data[$i]['type'][0]['title'];

But i can't find how to save the facebook number.I have tried a lot of combinaison

$number = $data[0]['type'][$i]['scores']['facebook'][0];

OR

$number = $data[0]['type'][$i]['scores']['facebook'];

OR

$number = $data[0]['type'][$i]['scores']['facebook'][1];

No one works... Do you have an idea ?Many thanks guys !


Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles



Latest Images