Hello guys, I want to make an array in such a way that if i have a specific value , assume 3 , then my array should be Array ( [1] => 1 [2] => 2 [3] => 3 ) But '3' will always change as it will be a variable.
So for '5' you will have: Array ( [1] => 1 [2] => 2 [3] => 3 [4] => 4 [5] => 5 ) If this is the case, this will do it: $a = array(); for($i=1; $i<=$variable; $i++) $a[$i] = $i; PHP: