我试图将多个 JSON 数据打印到 php,但它不起作用。这是代码:
$fql = "SELECT uid, name FROM user WHERE uid in (SELECT uid2 FROM friend where uid1 = $user)";
$ret_obj = $facebook->api(array(
'method' => 'fql.query',
'query' => $fql,
));
foreach ($ret_obj as $name) {
$friend = $name->name;
echo "Name: " . $friend . "<br />;
}
我想以以下格式显示我的 Facebook 好友列表:
Name: [friend's name]
Name: [friend's name]
Name: [friend's name]
提前致谢。