-1
 $likes = $facebook->api("/me/likes");
 foreach($likes['data'] as $page_likes) {
    if($page_likes['id'] == "someid") {

    }
  }

Is there any simple way to find it instead of looping those hundreds, thousands likes?

Kamini
  • 393
  • 1
  • 5
  • 16

2 Answers2

1

Best method (to answer questions like this): Read documentation …!

https://developers.facebook.com/docs/reference/api/user/#likes:

“You can check if a User likes a specific page by issuing an HTTP GET to /PROFILE_ID/likes/PAGE_ID. […] This will return, in the data array, an object with the following fields if the user is connected to the page: […] If the user is not connected to the page, the data array will be empty.”

CBroe
  • 91,630
  • 14
  • 92
  • 150
0

array_map or array_walk might be more efficient, but it depends on what you want to do with the data...

freytag
  • 4,769
  • 2
  • 27
  • 32
  • From this loop, If the page id is liked, i will end the loop and display some additional content. That is it. – Kamini Jul 22 '12 at 05:36