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

  • Home
  • SEARCH
  • 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 8379649
In Process

The Archive Base Latest Questions

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

I am a novice and though I manage to get things done, this issue

  • 0

I am a novice and though I manage to get things done, this issue is out of my reach.

Issue related to Facebook

https://graph.facebook.com/211255505590483/albums?fields=id

The above link displays the list of albums of a Facebook page. I want to extract all the “id” and put them in a dropdown list.
e.g.:
<option value="123456789">123456789</option>


This section added after response by @Mathieu to remove confusion:

Question: I need help to extract just the Album IDs which I can use for the dropdown list. I have tried “preg_match” but I am unable to isolate and get just the Album IDs. I am getting the entire content either as a single line or with line breaks and that includes “created_time” part also.


I already have a PHP script which can display all the photos of an album (of a Facebook Page) when I directly put the album “id” in it.

My ‘plan one’ is that whenever a visitor comes to my website, my page will fetch the list of album “id” and the photos can be viewed.

My ‘plan two’ is that the page can use a cron to fetch the list of album “id” once a day and store in a database and this will prevent multiple calls to Facebook.

I feel that since the list of album “id” is available through the above link, there would Not be any need for AccessToken, Secret, etc.

  • 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:14:51+00:00Added an answer on June 9, 2026 at 4:14 pm

    Done

    This script works only for a Facebook page to display all the Albums. You would need a separate script to show all the photos of any particular album.

    Edit: I have improved upon the solution. The script now gives the Album IDs in a dropdown box, The Album Name and Album Creation Date.

    <?php
    
    $facebook_page_owner = "211255505590483";
    
    $string = file_get_contents('https://graph.facebook.com/'.$facebook_page_owner.'/albums?fields=id,name,cover_photo');
    $jdata = json_decode($string);
    $albumcount = count($jdata->data);
    
    echo "There are ".$albumcount." Albums in this Facebook page.<br /><br />";
    
    echo "<form method=\"post\" action=\"".$_SERVER['PHP_SELF']."\">";
    
    echo "<select id=\"facebookalbumid\" name=\"facebookalbumid\">";
    
        $facebookalbumid = $_POST['facebookalbumid'];
        $i=0;
        while($i<=($albumcount-1))
            {
            $selected = ($jdata->data[$i]->id == $facebookalbumid) ? "selected='selected'" : "";
                if ($facebookalbumid == "") {
                $facebookalbumid = $jdata->data[$i]->id;
                }
            echo "<option value=\"".$jdata->data[$i]->id."\" $selected>".$jdata->data[$i]->id."</option>";
            $i++;
        }
    
    echo "</select>";
    
    echo " <input type=\"submit\" value=\"View Album\"></form><br />";
    
    
    $string2 = file_get_contents('https://graph.facebook.com/fql?q=SELECT%20name,%20created%20FROM%20album%20WHERE%20owner='.$facebook_page_owner.'%20and%20object_id='.$facebookalbumid.'');
    $adata = json_decode($string2);
    $facebookalbumname = $adata->data[0]->name;
    $albumdate = $adata->data[0]->created;
    $facebookalbumdate = date("d-M-Y", $albumdate);
    
    echo $facebookalbumname."<br />";
    echo $facebookalbumdate."<br />";
    
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

SQL novice here. I'm trying to get a list of invoice numbers. There are
Php novice. 1.Is there anything wrong with this PHP & MySQL code? include_once db_login.php
I am still a novice in the new stl members.Can anyone point out why
Well I cant figure this one out, it looks fine in Firefox, Chrome, Safari
I'm a novice at C++. Be patient if this is incoherent. I'm called upon
Due to a recent issue i had some days ago (you can check this
Though, i'm still a novice for ASP.NET MVC, my manager asked me for a
I am using a Scala compilation server. This is probably not related to my
While I'm going through Python code and seeing functions called, I notice things like
A novice at WPF / XAML, I've been wrestling with layout and trying to

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.