I want to generate or fill an array in a loop with variables (in php). But these variables are written in this loop.
so an example:
$i = 1;
while(i<10){
$a = array("$i","$i","$i");
i++;
}
the secound and the third i variables should be added in the next passage. So finaly the array will include the numbers from 0 to 10. I found something with $$variables but i don't thing there is a usefull usage.
What is a possible way for this? Thank you :)
I think you are stuck, that you don't know how to add an element to an array, which is something pretty basic.
Just add an element to your array every iteration like this:
Read up more about arrays here: http://php.net/manual/en/language.types.array.php