假設目前有陣列
$fruits = [
['id'=>0,'fruit'=>'apple','sweetness'=>2],
['id'=>1,'fruit'=>'banana','sweetness'=>4],
['id'=>2,'fruit'=>'grape','sweetness'=>5],
['id'=>3,'fruit'=>'orange','sweetness'=>1],
];
array_column(陣列變數, key名稱(想取得的column的key) , 返回新陣列的key(可填可不填));
print_r(array_column($fruits,'fruit'));
print_r(array_column($fruits,'fruit','sweetness'));
取得陣列的key
print_r(array_keys($fruits[0]));
print_r(array_keys($fruits));
取得陣列的value
print_r(array_values($fruits));