im trying to create simple array from foreach loop
function ptd_get_taxanomies(){
foreach ($ptd_taxs as $ptd_tax) {
$taxon_arg[] = array(
'taxonomy' =>$ptd_tax->taxonomy,
'field' => 'id',
'terms' => $values
);
}
return $taxon_arg;
}
, but it returns me multidimensional array,
Array
(
[0] => Array
(
[taxonomy] => application
[field] => id
[terms] => 8
)
[1] => Array
(
[taxonomy] => dimension
[field] => id
[terms] => 4
)
);
but this is not that i want, i need an output like this >
array(
'taxonomy' => 'application',
'field' => 'id',
'terms' => '8',
),
array(
'taxonomy' => 'dimension',
'field' => 'id',
'terms' => '4',
)
how do i remove the first level array and get the output like above