Q:

PHP pass and receive two dimensional array from form

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 if someone changes the name field, we are clear what record they are changing as this record is linked to other tables by id.
Originally tried two dimensional array...have abandoned that approach.  Now trying to use two one dimensional arrays as per suggestion below.  I am going with arrays because number of entries on form depends on how many categories user has created.  Categories table has id(int), cat(text) and userid(int) fields 
Difficulty with passing two arrays is how to link the two. If I pass categories as array to receiving page, I can iterate through values to produce sql statements to change each entry.  However, I can't figure out how to get correct id which is needed to identify record.  If I use a foreach($idarray as $id) inside the foreach(catsarray as $val) I will get multiple ids for each cat.  How do I iterate through ids in synch with iterating through cats?  Many thanks for help as I have now spent two days on this :(
//I am working with $catsarray and $idarray, each with identical indexes, 1,2,3 etc.
//How do I get appropriate id for each cat
foreach($catsarray as $val) {
$sql = "UPDATE cats, set name = $val WHERE (userid ='$userid' AND id=??????)";
mysql_query($sql);
}

A:

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
    }
}

