简体   繁体   中英

After upload photo, how can i retrieve the photo on my apps?

I am use following methods to upload photo :

$args = array('message' => 'Photo Caption');
$args['image'] = '@' . realpath($file);
$data = $facebook->api('me/photos', 'post', $args);
print_r($data);

After success to upload photo, $data return "Array ( [id] => 1.16874205038E+14 )" . How can i access the photo on my apps?

echo sprintf('%s', $data['id']);

With sprintf you can ask php to treat long number as a string and after that you can work with that string as you wish.

$photo = $facebook->api(sprintf('%s', $data['id']));

This will return an array of your photo details. http://developers.facebook.com/docs/reference/api/photo

PS: i'm not sure if you need an implicit casting to string in this particular case, so you can try to get the $photo with or without sprintf .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM