[英]Display Facebook image source by id
I am developing a Facebook application that stores into MySQL the photo[id]. 我正在开发一个Facebook应用程序,它将照片[id]存储到MySQL中。 I am using Facebook's Graph API to retrieve all of the user's photos and by a radio button the selected photo[id] is stored into mysql.
我正在使用Facebook的Graph API来检索所有用户的照片,并通过单选按钮将所选照片[id]存储到mysql中。
The problem is, how should I display the image's source by the id stored? 问题是,我应该如何通过存储的id显示图像的来源?
You inspect the Graph Object for that id, 您检查该图标对象的ID,
graph.facebook.com/photoID
For example a photo from facebook.com/facebook 例如来自facebook.com/facebook的照片
http://graph.facebook.com/427100966728
This will return a JSON response for which you can choose the size you desire for the source. 这将返回一个JSON响应,您可以为其选择所需的源大小。
For more information see, http://developers.facebook.com/docs/reference/api/photo/ 有关详细信息,请参阅http://developers.facebook.com/docs/reference/api/photo/
For example in the PHP SDK 例如在PHP SDK中
$a_photo = $facebook->api('/427100966728');
<img src=<?php echo $a_photo['picture'] ?> />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.