Parsing unknown POST Args in PHP
It looks like you may want to unset the 'item id' entry in your post array before you do the processing:

unset($_POST['item id']);

Then you can use foreach to loop over the key (idx) and value (operation).

foreach ($_POST as $idx =&gt; $operation)
{
    echo $idx . ' ' . $operation . '&lt;/br&gt;';
    // perform operation.
}


The array_keys function was unnecessary because foreach can be used with associative arrays handling both their keys and values.