How to generate int array with a range of numbers increments by specific step in PHP

1 Answer

0 votes
$array = range(0, 10, 2);

print_r($array);
 
 
 
 
/*
run:
 
Array
(
    [0] => 0
    [1] => 2
    [2] => 4
    [3] => 6
    [4] => 8
    [5] => 10
)

*/

 



answered Sep 22, 2023 by avibootz
...