Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.