<?php
$cooking = [
["menu_id" => "10","menu_name" => "カレー","submenu_name" => "ライス","drink" => "烏龍茶"],
["menu_id" => "20","menu_name" => "パスタ","submenu_name" => "タバスコ","drink" => "ビール"],
["menu_id" => "30","menu_name" => "焼き肉","submenu_name" => "ソース","drink" => "ジンジャエール"]
];
//↓一番早い
$menu = array_column($cooking, 'menu_name', 'menu_id');
$menu = array_column($cooking, null, 'menu_id');
↓2番早い 配列操作を覚えるには丁度よい
foreach ($cooking as $row) {
$data[$row['menu_id']] = $row['menu_name'];
}
var_dump($menu);
#結果
array(3) {
[10]=>
string(9) "カレー"
[20]=>
string(9) "パスタ"
[30]=>
string(9) "焼き肉"
}