Hey all! I'm having some trouble with some array assignment. I've made a call to my database and have it set as array 1. When I print_r on it the values look like this:
Array ( [0] => Array ( [0] => 0 [1] => 2190 [2] => 4000 [3] => 2011-10-01 [4] => 99.99 ) [1] => Array ( [0] => 0 [1] => 2189 [2] => 5000 [3] => 2011-10-01 [4] => 99.99 ) )
I'm trying to assign the values of this array element by element to another array (weeding out some entries from the first I don't like). However, in my assignment I end up with this:
Array ( [0] => Array ( [0] => 0 ) [1] => Array ( [1] => 2190 ) [2] => Array ( [2] => 4000 ) [3] => Array ( [3] => 2011-10-01 ) [4] => Array ( [4] => 99.99 ) [5] => Array ( [0] => 0 ) [6] => Array ( [1] => 2189 ) [7] => Array ( [2] => 5000 ) [8] => Array ( [3] => 2011-10-01 ) [9] => Array ( [4] => 99.99 ) )
The code:
if(condition){
for($i=0;$i<5;$i++){
$array2[$OutsideCounter][$i] = $array1[$OutsideCounter][$i];
}
}
Im sure this is some basic syntax screwup that i'm unaware of. Your help would be much appreciated! -slight