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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:06:11+00:00 2026-06-11T19:06:11+00:00

I have a php has below how i can echo in php. i want

  • 0

I have a php has below how i can echo in php.

i want to echo like this

Veg.Pizaa => 
          Extra = > Cheese, price 50
          Vegetables = > Avocado, price 25

The Array Is Below

array
  (
     'Veg.Pizaa' => 
      (
        array
          (
            'Extra' => 
             (
               array
                (
                 'name' => string '25g Cheese' (length=10),
                 'price' => string '50' (length=2),
                 'quanty' => int 13,
                 'Vegetables' =>
                ), 
               array
                (
                 'name' => string 'Avocado' (length=7),
                 'price' => string '25' (length=2),
                 'quanty' => int 13,
                 'Nuts' =>
                 ), 
               array
                (
                 'name' => string 'Almonds' (length=7),
                 'price' => string '30' (length=2),
                 'quanty' => int 21
                )
             )
          )
       )
    )

I’ve tried the following code

foreach($sub as $sub) {
  var_dump($sub);
  echo "<tr>";
  echo "<td><h3 style='font-weight: bolder; color: Maroon; line-height: 10px;'>".$sub[0]['productname']
    ."</h3></td>";
  echo "<td><h3 style='font-weight: bolder; color: Maroon; line-height: 10px;'>".$sub[0]['qty']
    ."</h3></td>";
  echo "</tr>";
}
  • 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-11T19:06:12+00:00Added an answer on June 11, 2026 at 7:06 pm
    $array = ...;
    
    foreach( $array as $key => $val )
    {
      echo $key . " =>\n";
    
      foreach( $val as $key2 => $val2 )
      {
        echo "\t" . $key2 . ' => ' . $val2['name'] . "\n";
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a php file which has some variables like $name1, $name2... How can
I have a php file which has a require_once Statement (?) this file is
Let's say i have an index.php that has html in it that looks like
This is what I want to know. I have a table which has the
I have a ecrtst.php which has 3 fields for input, on submit - submit-ecr.php.
I have a PHP script that has a runtime of 34 seconds. But it
I have a php form that has a known number of columns (ex. top
I have a PHP program that has been written keeping in mind a single
I have a php array that has a bunch of data that I need
I have an index.php file which has 2 included files require(stats.php); require(stats_encry.php); stats.php which

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.