Filter Friends that are Online FBML
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 onli开发者_Go百科ne ones in the array :D
Thanks
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.
精彩评论