我正在创建一些应用程序,facebook 应用程序,我需要问你一些事情。
我使用以下代码检索 like_friend 变量:
if(!empty($friends['data'])){
$like_friend = $facebook->api(array(
"method" => "fql.query",
"query" => "SELECT uid FROM page_fan WHERE page_id='".$page_id."' AND uid IN (SELECT uid2 FROM friend WHERE uid1=me())"));
$check_arr = array();
if(!empty($like_friend)){
foreach($like_friend as $likes){
$check_arr[] = $likes['uid'];
}
}
$like_friend_other = $facebook->api(array(
"method" => "fql.query",
"query" => "SELECT uid FROM page_fan WHERE page_id=184759054887922 AND uid IN (SELECT uid2 FROM friend WHERE uid1=me())"));
$check_arr1 = array();
if(!empty($like_friend_other)){
foreach($like_friend_other as $likes){
$check_arr[] = $likes['uid'];
}
}
$size = variable_get('facebook_graph_pic_size_nodes','square');
$protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
foreach($friends['data'] as $data){
if(!in_array($data['id'],$check_arr) && in_array($data['id'],$check_arr1)){
如果我只是复制它但将其命名为 $like_friend1 我可以像这样进行仔细检查:
if(!in_array($data['id'],$check_arr) && in_array($data['id'],$check_arr1)){