Sep 032010
Create an array containing a range of elements in PHP
Answer:
It is easy to create an array using the range() function, e.g.
<?php
foreach (range(0, 10) as $number) {
echo $number, " ";
}
It shows following when executed:
0 1 2 3 4 5 6 7 8 9 10