📅  最后修改于: 2022-03-11 14:58:56.933000             🧑  作者: Mango
You can get the $arraysToMerge using the array_column() function on $users like
this:
$arraysToMerge = array_column($users, 'socialMediaAccounts');
$arraysMerged = array_merge(...$arraysToMerge);
Matt suggested that you don't need to merge into an empty array, so I adapted
the code to his suggestion.