fork download
  1. <?php
  2.  
  3. $array_final = array();
  4. $array_atual = array (
  5.  
  6. 'id_item' => array('1', '3'), // 'id_item', 'id_item'
  7. 'cantidad' => array('15', '10') // 'cantidad', 'cantidad'
  8. );
  9.  
  10. foreach($array_atual['id_item'] as $key => $value){
  11. $newItem = array($value, $array_atual['cantidad'][$key]);
  12. array_push($array_final, $newItem);
  13. }
  14.  
  15. print_r($array_final);
Success #stdin #stdout 0.04s 23440KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Array
        (
            [0] => 1
            [1] => 15
        )

    [1] => Array
        (
            [0] => 3
            [1] => 10
        )

)