fork download
  1. <?php
  2.  
  3. $a = array( array("chamado_codigo"=>5,"representante_id"=>1), array("chamado_codigo"=>6,"representante_id"=>2) );
  4. $b = array( array("valor"=>"R$ 0,45"), array("valor"=>"R$ 0,50") );
  5.  
  6. $i=0;
  7. $novoArray = array();
  8. foreach($a as $valor) {
  9. $novoArray[] = array_merge($valor, $b[$i]);
  10. $i++;
  11. }
  12.  
  13. print_r($novoArray);
  14. ?>
  15.  
Success #stdin #stdout 0.02s 52472KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Array
        (
            [chamado_codigo] => 5
            [representante_id] => 1
            [valor] => R$ 0,45
        )

    [1] => Array
        (
            [chamado_codigo] => 6
            [representante_id] => 2
            [valor] => R$ 0,50
        )

)