0

在我正在制作的 facebook 游戏中,我终于得到了这个:

$app_using_friends = $facebook->api(array(
'method' => 'fql.query',
'query' => 'SELECT uid, name FROM user WHERE uid IN(SELECT uid2 FROM friend WHERE uid1 = me()) AND is_app_user = 1'
));

print_r($app_using_friends);

给我这个数组:

Array ( [0] => Array ( [uid] => 1609874007 [name] => Anne Abrams Nadel-Walbridge ) [1] => Array ( [uid] => 100000024696650 [name] => Abbye Dively ) [2] => Array ( [uid] => 100004264273000 [name] => Nelson Sheridan Crowe ) )

我已经玩了几个小时,似乎无法将某些内容写入每条记录以使用 php 循环显示。

4

1 回答 1

0

你可以像这样遍历这个数组:

foreach ($app_using_friends as $row) {
    echo $row['uid'] . ' ' . $row['name'];
}
于 2013-10-26T15:43:38.300 回答