$array = [
['name' => 'John', 'age' => 45],
['name' => 'Haley', 'age' => 42],
['name' => 'Ally', 'age' => 8],
['name' => 'Meylyn', 'age' => 5],
['name' => 'Nicholas', 'age' => 1],
];
$adults = array_filter($array, function($value) {
return $value['age'] > 18;
});
foreach ($adults as $adult) {
echo $adult['name'] . "<br/>";
}