PHP How to create array value using for loop ?
$my_array=array(
for ($i=0;$i<10;$i++)
{
$i,
}
);
echo '<pre>'; print_r($my_array); echo '<pre/>';
Simple for number arrays.
$my_array = range(0, 10);
If you want to add increment more then 1 you can
$step = 2;
$my_array = range(0, 10, $step);
$my_array = array();
for ($i=0;$i<10;$i++){
$my_array[]= $i;
}