0

I am testing with the Facebook API. I am trying to return the amount of friends with this array:

$friends = $facebook->api(array(
    "method"    => "fql.query",
    "query"     => "SELECT friend_count FROM user WHERE uid = me()"
));

Then I display it: print_r($friends); It displays as this:

Array
(
    [0] => Array
        (
            [friend_count] => 167
        )

)

I want to just get that number to display, the 167 in my case. I'm not quite sure how to do that. Any help is greatly appreciate. Thank you.

1 Answer 1

1

Try this.

echo $friends[0]['friend_count'];
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.