1
Hello, I am beginner and I have the following question, I have an array, where one of the parameters comes from the bank, where the number 5 is, comes from the bank.
$inicio = 1;
$ultimo = 5; //esse valor vem do banco.
$arr = range($inicio, $ultimo);
print_r($arr);
with the above code returns an array of 1 to the number registered in the database, in this example the 5.
following the example I would like to put this array in a select html, from 1 to 5 in case I tried with for but did not succeed, can someone give me a light? thank you
Only one detail, in this case the value ($k) would always be -1 compared to the one displayed in the option ($v), since one part of 0 and the other of 1.
– Inkeliz
It worked perfectly Vinicius, thank you very much, I understood well the use of foreach.
– Denis L. Murara