fork download
  1. <?php
  2.  
  3. $array = [
  4.  
  5. ['TIPO' => 3, 'NOME' => "Soda"],
  6.  
  7. ['TIPO' => 5, 'NOME' => "Coca Cola"],
  8.  
  9. ['TIPO' => 3, 'NOME' => "Fanta"],
  10.  
  11. ['TIPO' => 1, 'NOME' => "Antártica"],
  12. ];
  13.  
  14.  
  15. $tipos = array_map(function ($value) { return $value['TIPO']; }, $array);
  16.  
Success #stdin #stdout 0.02s 52432KB
stdin
Standard input is empty
stdout
array(3) {
  [3]=>
  int(2)
  [5]=>
  int(1)
  [1]=>
  int(1)
}