phpflickr - 如何通过所有者ID获取照片所有者用户名?

时间:2011-06-16 22:31:45

标签: php phpflickr

<?php 
//...

$tags = $api->photos_search(array(
    'text' => 'stuff',
));

foreach ($tags['photo'] as $photo) {
    // want to get get the user's actual username from the the "owner"
    $ownerId = $photo['owner'];
    // getUsernameById($ownerId); // <-- how do you do this?
}

1 个答案:

答案 0 :(得分:1)

我从未使用过该库,但根据Flickr API,该函数最初被称为flickr.people.getInfo

PHP类遵循此命名约定。我会试试

$userinfo = $api->people_getInfo($ownerId);
var_dump($userinfo['username']);
祝你好运!