Why do I get 'undefined variable $image_src' with this code:
$image_src1=null;
$image_src2=null;
for ($i=1; $i<=$nr_of_pics; $i++) {
$image_src.$i = $image_id.'_'.$i;
}
echo $image_src1;
I want the $image_src.$i to refer to the variable $image_src1 or $image_src2 depending on how many loops there are... But it wants to find the variable $image_src without an ending nr, which doesn't exist, because I want it to find the variable with the '$i' ending!
It doesn't get that the $i is for the last number in the variable $image_src name!
Rest of the code is fine!
Thanks