How do I use JSON objects from Facebook with PHP? -
I'm trying to capture some of the values of Facebook JSON, even PHP also has an object i.e., location of location, location and participation in people. Using the graph API.
& lt ;? PHP $ Jasonurl = "Https://grafkfesbukkcom/33l2l8348435?akses_tokn=2227470867:2krtbzmkvivgkgz7Xr4px3Dw__k3600kl280822400-6628l7093&mpi_uhk_2SKQFel3XxpKJ09GEo4." ; $ Json = file_get_contents ($ jsonurl, 0, null, null); $ Json_output = json_decode ($ json); The How to echo the values of JSON output? I'm assuming that it will be returned as an array.
Thank you!
If you are using PHP, you can use it to query the API This means that you can make the call:
$ user = $ facebook- & gt; API ('/ someusername', array ('fields' = & gt; 'id, first name, last_name ..'));
However, with your example, you can do the following:
$ url = "https://graph.facebook.com/331218348435 ? Access_token = 2227470867 | 2.rtBZMkVIVgKGZ7Xr4px3Dw __3,600.1280822400-662,817,093 | apY_UHK_2SKQFel3XxpKJ09GEo4 ".. $ User = Jason_dikod (Fail_get_kantents ($ Jasonurl)); Copy $ user ['first_name'];
As you use json_decode
, the result should be interpreted in the original PHP array (or in the same case, in one object).
Comments
Post a Comment