To create an array of a series of consecutive numbers or alphabetical letters or even any ASCII characters, you can use PHP function range():
$a = range(0, 100, 2); // $a is an array of even integers from 0 to 100.
$b = range('a', 'z'); // $b now contains all lowercase alphabetic letters from a to z.
To create an array of a series of identical values, use function array_fill():
$dumb = array_fill(-10, 3, 'dumb');
$dumb is as follows:
Array
(
[-10] => 'dumb'
[-9] => 'dumb'
[-8] => 'dumb'
)
Yeah.
Pingback: PHP: Create an Array