tags:

views:

18

answers:

1

Hi

Ok, I have this array of a users friends, and I'm just wondering how I can filter out the ones that are offline so that I only have the online ones in the array :D

Thanks

+1  A: 

You don't need to do that, you just have to account for current logged in user whether it is you or anyone else and behind the scenes it will be however is logged in. You should simply make a check if a user is logged in (any user including friend):

if ($facebook->user > 0 && isset($facebook->user))
{
  // your code here....
}

The code in the condition will run only if a user is logged in.

Sarfraz
So I would do $facebook->$userid right?
Belgin Fish
@Belgin: It is `$facebook->user` as shown in my example code.
Sarfraz
yeah but where do i specify the user id?
Belgin Fish
@Belgin Fish: You know that better (a reason why you have asked the question) but whereever you want to make sure that user needs to be logged in for a particular action to be performed.
Sarfraz

related questions