Good night, gentlemen, there are several arrays in which the values ​​are different

Here is one of them,

$ar1 = Array( "id" => "7777", "product_id" => "777", "meta_key" => "primer", "meta_value" => "1", "custom" => "0" ); 

How do i find the value

 "meta_value" 

if i know

 "meta_key" => "primer" 

thank

    1 answer 1

    For example, combine all arrays into one:

     $glob = array($ar1, $ar2); foreach($glob as $item) { if($item['meta_key'] === "primer") { echo $item['meta_value']; } } 
    • It helped thanks! - do4a