i am trying to push multiple arrays into 1 big array, resulting in a 2 lvl array.
I got this set of arrays for example:
Array ( [cod] => ffffd [denum] =
All these answers are nice however when thinking about it....
Sometimes the most simple approach without sophistication will do the trick quicker and with no special functions.
We first set the arrays:
$arr1 = Array(
"cod" => ffffd,
"denum" => ffffffffffffffff,
"descr" => ggggggg,
"cant" => 3
);
$arr2 = Array
(
"cod" => fff,
"denum" => dfgdfgdfgdfgdfg,
"descr" => dfgdfgdfgdfgdfg,
"cant" => 33
);
Then we add them to the new array :
$newArr[] = $arr1;
$newArr[] = $arr2;
Now lets see our new array with all the keys:
print_r($newArr);
There's no need for sql or special functions to build a new multi-dimensional array.... don't use a tank to get to where you can walk.