I have a form that runs through a database and outputs values like this:
for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
echo '<input type="hidden" value="'.$order->products[$i]['qty'].'" name="qty[]">';
echo '<input type="hidden" value="'.$order->products[$i]['name'].'" name="name[]">';
echo '<input type="hidden" value="'.$order->products[$i]['final_price'].'" name="price[]">';
}
I need to rearrange the posted result, after submitting the form, so that I have an array containing "qty, name, price" for each line, instead of "qty, qty, qty, qty, qty" and "name, name...etc"
What is the best way of going about this? I am comfortable with loops, but I don't know how to go about this particular problem of rearranging the form data...