fork download
  1. <?php
  2.  
  3. $arr = array(array('name' => 'email', 'value' => 'teste@teste.com'),
  4. array('name' => 'code', 'value' => 'D9CI8C'),
  5. array('name' => 'nome', 'value' => 'fulano'),
  6. array('name' => 'problema', 'value' => 'algo errado')
  7. );
  8.  
  9. $novo = array_combine(array_column($arr,'name'), array_column($arr,'value'));
  10.  
  11. print_r($novo);
Success #stdin #stdout 0.02s 23708KB
stdin
Standard input is empty
stdout
Array
(
    [email] => teste@teste.com
    [code] => D9CI8C
    [nome] => fulano
    [problema] => algo errado
)