HI
I want to add two element in a array. the first one is
the key and the second is the value.but I want to add it
dynamically. i want to do it like the following code:
$arr="";
for($i=0;$i<20; $i++) {
$arr[$i]=arr($i=>$i+1);
array_push($arr[$i]);
}
print_r($arr);
But of couse it don't work. Could anyone tell me how
to do it ?
Thx
Ricky
I want to add two element in a array. the first one is
the key and the second is the value.but I want to add it
dynamically. i want to do it like the following code:
$arr="";
for($i=0;$i<20; $i++) {
$arr[$i]=arr($i=>$i+1);
array_push($arr[$i]);
}
print_r($arr);
But of couse it don't work. Could anyone tell me how
to do it ?
Thx
Ricky
Comment