从html发布数组

im trying to pass the values from a multislect object in html to some code in PHP, and get "Notice: Undefined index: VAR_VLAN[0]" in output

html code:

    <tr id="port1">
        <td><input type="radio" name="radio" value="1" checked="checked" /></td>
        <td><input type="text"  name="VAR_MNEMO[1]" placeholder="Uplink" /></td>
        <td><input type="text"  name="VAR_VLAN[1]" /></td>
    </tr>
    <tr id="port2">
        <td><input type="radio" name="radio" value="2" /></td>
        <td><input type="text"  name="VAR_MNEMO[2]" /></td>
        <td><input type="text"  name="VAR_VLAN[2]" /></td>

php code:

<?php
foreach ($_GET['VAR_MNEMO'] as $key => $value)
 {
  echo 'cr vlan '.$value.' tag '.$_GET['VAR_VLAN['.$key.']'].'<br />
  config vlan '.$value.' add tagged '.$uplink.'<br />
  config vlan '.$value.' add untagged '.$key.'<br /><br />'.PHP_EOL;
}
?>

$_GET['VAR_VLAN'] is an array, whose key is $key. VAR_VLAN[$key] is not a key in $_GET. So you want $_GET['VAR_VLAN'][$key].

<?php
foreach ($_GET['VAR_MNEMO'] as $key => $value)
 {
  echo 'cr vlan '.$value.' tag '.$_GET['VAR_VLAN'][$key].'<br />
  config vlan '.$value.' add tagged '.$uplink.'<br />
  config vlan '.$value.' add untagged '.$key.'<br /><br />'.PHP_EOL;
}
?>