if($user_gender == "male")
{
$fql_query_result = file_get_contents("https://graph.facebook.com/fql?q=SELECT+uid%2C+name+FROM+user+where+uid+IN+(SELECT%20uid2%20FROM%20friend%20WHERE%20uid1%20=%20me())%20and%20sex='female'ORDER%20BY%20rand%20()%20LIMIT%201&access_token=".$access_token);
}
else
{
$fql_query_result = file_get_contents("https://graph.facebook.com/fql?q=SELECT+uid%2C+name+FROM+user+where+uid+IN+(SELECT%20uid2%20FROM%20friend%20WHERE%20uid1%20=%20me())%20and%20sex='male'ORDER%20BY%20rand%20()%20LIMIT%201&access_token=".$access_token);
}
在 Graph Api Explorer 中显示
{
"data": [
{
"uid": 100001242402868,
"name": "Don Omer"
}
]
}
如何从上述数据中提取 UID,以便我们可以显示他/她的头像
$friend_pic = imagecreatefromjpeg("http://graph.facebook.com/".$fql_query_result['uid']."/picture?type=normal");
我正在尝试创建一个名为“谁会嫁给我”的应用程序。
提前致谢