Hear is my code. I would like to get picture with api php facebook.
The variable $photo returns NULL value.
<?php
$profile = $facebook->api('/<idfacebook>');
$photo = $facebook->api('/'.$profile['username'].'/picture');
?>
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
From stackoverflow.com/questions/2821061
“Simply fetch the data through this url:
http://graph.facebook.com/sarfraz.anees/picture
Replace sarfraz.anees (my name) with name of the user you want to get the photo of.
You can use the PHP’s
file_get_contentsfunction to read that url and process the retrieved data.Resource:
http://developers.facebook.com/docs/apiNote: In php.ini, you need to make sure that openssl extension is enabled to use the
file_get_contentsfunction of PHP to read that url. “