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 8881629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:23:13+00:00 2026-06-14T20:23:13+00:00

I should say first of all I’m not a PHP guy, so if anyone

  • 0

I should say first of all I’m not a PHP guy, so if anyone can help with this, I’ll do my best to understand any suggestions.

I have the following code that accesses an API and outputs some of the data, via PHP wrapper:

$idMovie=11;
$pelinfo = $tmdb_V3->movieDetail($idMovie);

<h1><?php echo $pelinfo[original_title]; ?></h1>
<h2><?php echo $pelinfo[release_date]; ?></h2>
<img src="<?php echo $pelinfo[poster_path]; ?>">
<p><?php echo $pelinfo[overview]; ?></p>

This works fine, it shows the data for one item. What I need to do though is show the data for many more items. So far I’ve just repeated the block and changed the $idMovie variable – but this is of course, is not the way to do it.

I think I need to do this:

  1. Set up an array to hold each variable, so $idMovie[12,34,56,78]

  2. Create a loop to go through each variable, and output the data using
    my code block above.

If anyone can point me in the right right direction, that would be most helpful.

Thanks
Dave

  • 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-14T20:23:14+00:00Added an answer on June 14, 2026 at 8:23 pm
    $idMovie = array(12,34,56,78);
    
    foreach($idMovie as $id){
       $pelinfo = $tmdb_V3->movieDetail($id);
    
       echo "<h1> $pelinfo[original_title] </h1>
             <h2> $pelinfo[release_date] </h2>
             <img src='$pelinfo[poster_path]'>
             <p>$pelinfo[overview]</p>";
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First off I should say that I don't have any experience in working with
First of all I should probably say that the term 'constant object' is probably
First of all, please excuse any typo as English is not my native language.
First of all, I should say that I'm starting to learn git so that
I should say first, that I'm not very well-versed in testing my code, and
First of all, let me say that I am not looking for a GUI
First of all, this is not about making the PictureBox control transparent. It's about
First of all, I do not have any code written yet, I am only
First of all, let me just say that I'm using the PHP framework Yii,
This is my first post, so first of all I want to say a

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.