fork(9) download
  1. <?php
  2. $array = array(array('nome' => 'Luis', 'id' => 1), array('nome' => 'Rui', 'id' => 2));
  3.  
  4. $nomes = array();
  5. array_walk_recursive($array, function ($item, $key) {
  6. global $nomes;
  7. if ($key == 'nome') $nomes[] = $item;
  8. });
  9.  
  10. var_dump($nomes);
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
array(2) {
  [0]=>
  string(4) "Luis"
  [1]=>
  string(3) "Rui"
}