我使用此代碼來獲取好友信息進行排序打印的assosiative陣列的關鍵
<?php
$fql = "SELECT uid, name, pic_square FROM user WHERE uid = me() OR uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) ";
$fUIDS = $facebook->api(array(
'method' => 'fql.query',
'query' =>$fql,
));
print_r($response);
?>
現在我需要表現出這樣
echo '<img src="'.$response['pic_square'].'"/>';
的結果,但它沒有工作,所以我這樣做
$fql = "SELECT pic_square FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) ";
$fPics = $facebook->api(array(
'method' => 'fql.query',
'query' =>$fql,
));
$i=count($fPics);
echo 'Total '.$i.' entries found !<br/>'; // this lines shows 10 as expected :)
for ($x=0;$x<$i;$x++)
echo '<img src="'.$fPIcs[$x].'"/>';
現在它顯示Array
10倍,有什麼問題?
是的,它的工作,thnx! – Sourav 2011-04-07 05:57:36