fork download
  1. <?php
  2.  
  3. $array = array (
  4. 0 => array ( "id" => "x", "dbfield" => "y"),
  5. 1 => array ( "id" => "quantity", "dbfield" => "QUANTITY_NEW")
  6. );
  7.  
  8. $dbfield = array_filter(array_map(function($a){
  9. if($a["id"] === "quantity"){
  10. return $a["dbfield"];
  11. }
  12. }, $array));
  13.  
  14. print_r($dbfield);
Success #stdin #stdout 0.02s 20568KB
stdin
Standard input is empty
stdout
Array
(
    [1] => QUANTITY_NEW
)