How to create arrays in a HTML  

by ne on 2021-09-29 under C#/Php

To get your <form> result sent as an array to your PHP script you name the <input>, <select> or <textarea> elements like this:


<input name="catlist[]">
<input name="catlist[]">
<input name="catlist[]">
<input name="catlist[]">

Treat the received information in your PHP script like this:


$num_cat = count ($catlist);
for ($i = 0; $i < $num_cat; $i++) {
 ... $catlist[$i] ...
}

if above code is helpfull for you than please share