My PHP code has several PHP variables like this.
$a0 = $arr[0]['id'];
$a1 = $arr[1]['id'];
$a2 = $arr[2]['id'];
$a3 = $arr[3]['id'];
$a4 = $arr[4]['id'];
I want to create these PHP variables using a for
loop
This is what I tried so far. But it’s not working.
for($i=0; $i<5; $i++)
{
$a.''.$i = $arr [$i]['id'];
}
Can anyone please help me?