Php quickly removes a key value from a two-dimensional array

$arr = array(  
  "0"=>array(  
            "name"=>"james",  
            "age"=>30,  
            ),  
  "1"=>array(  
            "name"=>"susu",  
            "age"=>26,  
            )
)

how to quickly eliminate the value of name
result:

$arr = array(  
  "0"=>array(   
            "age"=>30,  
            ),  
  "1"=>array(   
            "age"=>26,  
            )
)

I am now implementing

in a loop.
Dec.03,2021

array_column-returns a column specified in the array

print_r(array_column($arr, "age"));

< H2 > there are two ways to look forward to a better one. < / H2 >
foreach($arr as &$item){
    unset($item['name']);
}
unset($item);
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-1b36627-40598.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-1b36627-40598.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?