Php two-dimensional array, according to a certain field value, take out a new array, is there such a function?

$a = [
    ["name" => "fk", "age" => 30],
    ["name" => "yy", "age" => 28],
    ["name" => "zz", "age" => 30],
    ["name" => "ee", "age" => 29],
];

fetch the array of age=30

$a = [
    ["name" => "fk", "age" => 30],
    ["name" => "zz", "age" => 30],
];
Is there such a function for

?

Php
Mar.14,2021

array_filter


deal with it yourself

<?php

$a = [
    ['name' => 'fk', 'age' => 30],
    ['name' => 'yy', 'age' => 28],
    ['name' => 'zz', 'age' => 30],
    ['name' => 'ee', 'age' => 29],
];

$a = array_filter($a, function ($item) {
    return $item['age'] === 30;
});

var_dump($a);

what if you want to form another array based on the same age?
is output as:

$a = [
    ['age' => 30 ,name=> ['fk','zz']]
    ['name' => ['yy'], 'age' => 28],
    ['name' => ['ee'], 'age' => 29],
];

to achieve this effect, how to deal with it?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e9c66e-46355.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e9c66e-46355.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?