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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:45:42+00:00 2026-05-15T19:45:42+00:00

How can i make an array like below through a loop? The text will

  • 0

How can i make an array like below through a loop? The text will generated from database!

 $listofimages = array(
        array(  'titre' => 'PHP',
                'texte' => 'PHP (sigle de PHP: Hypertext Preprocessor), est un langage de scripts (...)',
                'image' => './images/php.gif'
        ),
        array(  'titre' => 'MySQL',
                'texte' => 'MySQL est un système de gestion de base de données (SGDB). Selon le (...)',
                'image' => './images/mysql.gif'
        ),
        array(  'titre' => 'Apache',
                'texte' => 'Apache HTTP Server, souvent appelé Apache, est un logiciel de serveur (...)',
                'image' => './images/apache.gif'
        )
    );
  • 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-05-15T19:45:43+00:00Added an answer on May 15, 2026 at 7:45 pm

    Something like :

    $listofimages = array();
    
    foreach ( $rowset as $row ) {
    
        $listofimages[] = array(
            'titre' => $row['titre'],
            'texte' => $row['texte'],
            'image' => $row['image']
        );
    
    }
    

    ?

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

Sidebar

Related Questions

I will have a string like below var str = -#A This text belongs
I am returning results from a MySql database in PHP that I would like
The goal here is to loop through the multidimensional array below and find user's
How can I make an array with 400 elements of type myClass and pass
I can make my program write a .dat file with an array of Node
How can I make a random 4x4 array<array<int,4>,4> ? Each element of this 2D
How can I make this code work? class Meta @array = [:a,:b] def self.method_missing(name,
I can make a variable's name from two variables' value: $a = 'tea'; $b
I have a form to upload image like below <form name=sample enctype=multipart/form-data action=index.php method=post
I tried so hard, but I could not make the decorator like below format

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.