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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:27:14+00:00 2026-05-28T06:27:14+00:00

I just have a little question, I can’t find any answer since I don’t

  • 0

I just have a little question, I can’t find any answer since I don’t know exactly how to formulate it on Google.

So I have this array returned from a query:

Array
(
    [0] => Array
        (
            [aad3177ec0cbced7a15fae003bdd0ff3] => Array
                (
                    [rowid] => aad3177ec0cbced7a15fae003bdd0ff3
                    [id] => 21
                    [qty] => 1
                    [price] => 176
                    [name] => KRUPS YY1305 
                    [image] => utilities/images/products/p2070396dt.jpg
                    [description] => Menu simplifié pour une convivialité optimale.   
                    [subtotal] => 176
                )
        )
)

And I want to get all the information rowid, id, qty … to store it through a foreach loop in another variable without knowing the name of the second array : ‘aad3177ec0cbced7a15fae003bdd0ff3’. I just want to retrieve articles from a cart stored in a database when user logged out.

So how can I say something like :

echo $myArray['0'][theNumberGoesHereAutomatically]['price'];

Ideally, my code would look like that :

foreach ($data2 as $cart){
            $data = array(
                   'rowid'      => $cart_unserialized[$token]['aad3177ec0cbced7a15fae003bdd0ff3']['rowid'],
                   'id'         => $cart_unserialized[$token]['aad3177ec0cbced7a15fae003bdd0ff3']['id'],
                   'qty'        => $cart_unserialized[$token]['aad3177ec0cbced7a15fae003bdd0ff3']['qty'],
                   'price'      => $cart_unserialized[$token]['aad3177ec0cbced7a15fae003bdd0ff3']['price'],
                   'name'       => $cart_unserialized[$token]['aad3177ec0cbced7a15fae003bdd0ff3']['name'],
                   'image'      => $cart_unserialized[$token]['aad3177ec0cbced7a15fae003bdd0ff3']['image'],
                   'description'=> $cart_unserialized[$token]['aad3177ec0cbced7a15fae003bdd0ff3']['description'],
                );
            $this->cart->insert($data2);
            $token++;
        };

without knowing the aad3177ec0cbced7a15fae003bdd0ff3.

Any ideas? Thanks 🙂

  • 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-28T06:27:15+00:00Added an answer on May 28, 2026 at 6:27 am

    You can do this easily with:

    foreach ($data2 as $varname => $cart){
    

    $varname will contain aad3177ec0cbced7a15fae003bdd0ff3.

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

Sidebar

Related Questions

Ok. I have looked EVERYWHERE and my little brain just can't understand a better
i have just started programming for android and i have a little question i
I have just a little question. I searched on the net but I have
i got a little question, i just can't understand, what is the problem and
Just a little question. How can I implements a double redirect between three page?
I just started out with C and have very little knowledge about performance issues
It's a theorical doubt. Suppouse you have a little library with just two files:
Just a little confused here... I have a function in postgres, and when I'm
I just have this issue with reading from a network stream in C#. Since
i have a little question about the verbatim environment in latex..... my problem is

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.