I have fetched friend list from facebook using below code:
$session = $facebook->getSession();
if ($session) {
$uid = $facebook->getUser();
$friends = $facebook->api('/me/friends');
}
foreach ($friends as $key=>$value) {
echo count($value) . ' Friends';
echo '<hr />';
echo '<ul id="friends">';
foreach ($value as $fkey=>$fvalue) {
echo '<li><img src="https://graph.facebook.com/' . $fvalue->id . '/picture" title="' . $fvalue->name . '"/></li>';
}
echo '</ul>';
}
I have one query that I have fetched friend list from facebook using this API, but I have one input box where I have type john
then this friend list should contain list of friends whose name is 'jhon'. How can I implement this functionality in existing code?
Thanks