I want to dynamically create arrays of arrays and I have no clue how to initialize my arrays...
Here is the code:
$resT= array();
$resR= array();
foreach ($cursor as $obj) {
if ($obj == NULL) continue;
$c="XX";
if (test1) $c=$obj['GC'];
array_push($resT[$c],$obj['AT']);
array_push($resR[$c],$obj['AR']);
}
I got this: array_push() expects parameter 1 to be array
Thanks,
Amir.
$resT,$resR,$objand so on are not very useful names. A variable name should always speak for itself.