0

I have an array eg orders. This array has 2 arrays with order details

How can I loop through each order and retrieve fields from all orders?

Here is my code

foreach($order as $row)

 {?>

  <div><?php $order['order_id'] ?></div>

<?

}

It doesn't show anything because it access the first array which holds the orders. Is there a way to access the second array inside the div tags?

1 Answer 1

2
foreach($order as $row)

 {?>

 <div><?php echo $row['order_id'] ?></div>

 <?

 }
Sign up to request clarification or add additional context in comments.

1 Comment

Yes that solved the issue. Will mark correct soon. Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.