Jump to content

Link to array


manix

Recommended Posts

Okay this is the first time I'm doing this and I don't really know where to start at,

 

Basically I need all the information from this link:

 

https://graph.facebook.com/manixchy

 

to be returned in an array like

 

$facebook["id"] = 100001240111056

$facebook["name"] = "Manix Hmr"

 

and so on for the rest of the information.. Is that like possible?

Link to comment
https://forums.phpfreaks.com/topic/244602-link-to-array/
Share on other sites

I managed to somehow retrieve it lol, here's the code and it works brilliant

 

$URL = "http://graph.facebook.com/manixchy";
$handle = fopen ($URL, "r");
$key = str_replace(' ', '%20',fread($handle, 1000000));
$key = json_decode($key, true);
var_dump ( $key );

 

Thanks JaySonic

Link to comment
https://forums.phpfreaks.com/topic/244602-link-to-array/#findComment-1256381
Share on other sites

There's a problem.. neither fopen nor file_get_contents manage to open a file using secure connection "https", and if I use unsecured one then facebook API says I need to use a secure connection... Really stuck this time, how do I open "https://graph.facebook.com/272908049391413/feed?access_token=somesuperlongcode" ?

Link to comment
https://forums.phpfreaks.com/topic/244602-link-to-array/#findComment-1256569
Share on other sites

file_get_contents() can use ssl connection.  You can pass that in through the 3rd argument.

 

http://www.php.net/manual/en/function.file-get-contents.php

 

It will take a bit of reading for you to get it in there though.  You will also have to provide a file location of your certificate.  As well as use other functions.

http://www.php.net/manual/en/function.stream-context-create.php

http://www.php.net/manual/en/context.ssl.php

Link to comment
https://forums.phpfreaks.com/topic/244602-link-to-array/#findComment-1256691
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.