I have something like this:
$target = array();
foreach($ugczfips as $area)
{
$temp = array('state' => $area['state'], 'zone' => $area['zone']);
$target[] = $temp;
}
Of course, the problem is that every loop overwrites the previous contents of $temp so the data gets lost.
What’s the correct way to do this?
It seems like one would need: $target = new array(); but that doesn’t work!
Michael provided the correct answer: