0

我正在创建一些应用程序,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)){
4

1 回答 1

1

简而言之,是的。

在这种情况下,最好的方法是简单地尝试一下,看看会发生什么;)

于 2012-06-27T22:27:14.153 回答