foreachループから単純な配列を作成しようとしています
function ptd_get_taxanomies(){
foreach ($ptd_taxs as $ptd_tax) {
$taxon_arg[] = array(
'taxonomy' =>$ptd_tax->taxonomy,
'field' => 'id',
'terms' => $values
);
}
return $taxon_arg;
}
、しかしそれは私に多次元配列を返します、
Array
(
[0] => Array
(
[taxonomy] => application
[field] => id
[terms] => 8
)
[1] => Array
(
[taxonomy] => dimension
[field] => id
[terms] => 4
)
);
しかし、これは私が望むものではありません。このような出力が必要です >
array(
'taxonomy' => 'application',
'field' => 'id',
'terms' => '8',
),
array(
'taxonomy' => 'dimension',
'field' => 'id',
'terms' => '4',
)
最初のレベルの配列を削除して、上記のような出力を取得するにはどうすればよいですか