Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8381201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:38:38+00:00 2026-06-09T16:38:38+00:00

I was looking to find an answer to my question, but so far I

  • 0

I was looking to find an answer to my question, but so far I got this:

https://graph.facebook.com/the_user_id?fields=name,picture

I need to be able to display/print first,last name and picture of a set list of users for which I know their ID. What code is required to get this data and then to publish it on a php/html page? Of course, this will means that if I want to show 10 users, I will input 10 different IDs (read smtg about an array list?). Notice that I DO NOT require for this to work for the current user.

Thanks in advance for your replies.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T16:38:40+00:00Added an answer on June 9, 2026 at 4:38 pm

    You need to use file_get_contents ( https://www.php.net/file_get_contents ) or curl in php and issue a request to the url such as follows:

     https://graph.facebook.com/?ids=id1,id2,id3&fields=name,picture
    

    (replacing id1,id2 with your ids)

    this will then return you a json object. You then need to decode ( https://www.php.net/json_decode ) and loop through this and access the information

    this should get you started

    // people array uses the users id as the key and the dessert as the value. The id is then used in the query to facebook to select the corresponding value from this array
    $people = array("id1"=>"favourite "dessert", "id2"=>"favourite dessert", "id3"=>"apple pie");
    
     $json = file_get_contents('https://graph.facebook.com/?ids=id1,id2,id3&fields=id,name,picture');
     $json = json_decode($json);
    foreach($json as $key=>$person){
       echo '<p><img src="'.$person->picture.'" alt="'.$person->name.'" />';
       echo $person->name.'\'s favourite dessert is '.$people[$person->id'];
       echo '</p>';
    }
    

    I’ve batched the requests here, alternatively you could perform 10 separate queries for each user, but that would be a bit pointless and inefficient

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been looking for this, but can't find the answer. I have an NSMutableArray
I tried looking this up on here but couldnt find a proper answer. I
Was looking for the answer on the net, but couldn't find anything. This little
This may be a basic question but the answer has alluded me so far.
I originally posted this question looking for an answer with using python, got some
I've been looking far and wide, but I can't find an answer, probably because
Apologies for this question but I can't find proper answer on the web. I'm
I've been looking for the answer to this question but it seems quite difficult
Simple question but I can't find the answer anywhere on MSDN... Looking for the
Right, simple question here. I couldn't find an answer using google and looking here.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.