3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = ['sr_no' => 72, 'batch_id' => 1]; $array2 = [ ['quantity' => 22, 'sr_no' => 71, 'batch_id' => 2, 'inq_id' => 91], ['quantity' => 35, 'sr_no' => 72, 'batch_id' => 1, 'inq_id' => 92], ['quantity' => 20, 'sr_no' => 69, 'batch_id' => 3, 'inq_id' => 90], ]; $result = null; foreach ($array2 as $row) { if (array_intersect_assoc($array1, $row) === $array1) { $result = $row; break; } } var_export($result);

preferences:
29.27 ms | 405 KiB | 5 Q