PHP - copy an array does not work

MU HaZE

New Member
I have an array:\[code\]print_r($resultArray);Array( [AB34] => Array ( [a] => 13 => 10 [c] => 3 [d] => 88 [e] => 73 ) ...)\[/code\]And I want to copy this array into another one:\[code\]$resArray[] = $resultArray;print_r($resArray);\[/code\]-> \[code\]Array( [0] => 1)\[/code\]So the new array $resArray does not have the content of $resultArray.What needed to be done to solve this?Best Regards.UPDATE: I have to copy the $resultArray into $resArray (that's an easy example), because $resultArray will change and I need the data in a $resArray with index, so $resArray[0] the first $resultArray, $resArray[1] the second full value of the $resultArray, ... Some code (only a simple example!):\[code\]$resArray[0] = $resultArray;... calculations on $resultArray ...$resArray[1] = $resultArray;... calculations on $resultArray ...$resArray[2] = $resultArray;... calculations on $resultArray ...\[/code\]
 
Back
Top