I am trying to pass two paired variables, a category and its id for multiple user-created categories from a webform to a file for processing. I want to keep them linked so
good and single syntax for creating two dimensional array;
<input type="text" name="cat[]" value="cat1">
<input type="text" name="cat[]" value="cat2">
...
While receiving cats;
echo $_POST['cat'][0] // echoes cat1
echo $_POST['cat'][1] // echoes cat2
Further example;
According to this definition,
<input type="text" name="cat[$cat][$id]" value="cat1">
foreach ($_POST['cat'] as $a=>$b){
// $a == $cat
foreach($b as $c=>$d) {
// $c == $id
}
}