fork(1) download
  1. <?php
  2. $arr = Array
  3. (
  4. (
  5. 'car' => 'Toyota'
  6. )
  7.  
  8. (
  9. 'car' => 'Ford'
  10. )
  11.  
  12. (
  13. 'car' => 'Isuzu'
  14. )
  15.  
  16. (
  17. 'car' => 'Chevrolet'
  18. )
  19.  
  20. );
  21.  
  22. $new_arr = array_map(function($x){return $x['car'];}, $arr);
  23.  
  24. print_r($new_arr);
  25.  
  26.  
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Toyota
    [1] => Ford
    [2] => Isuzu
    [3] => Chevrolet
)