Skip to content
Advertisement

How stop problem of overwriting in array using foreach php

JavaScript

}

Here in $output1 i always get the latest data, but i want all the data . The data is been over written in $output1 .

So how can i add $customer_details_value as well as $cart_details_value both in $output1.

Here after adding $cart_details_value in $output it over rides value of $customer_details_value in $output1

Advertisement

Answer

You need to define your $output1 before the loops:

JavaScript

And better start using informative variable names, to easy read the code and find the errors.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement