- print_r: documentation ( source)
- array_merge: documentation ( source)
<?php
$aPools = [];
$aPools[1] = [
'Redeployment' => 100,
'TalentPool' => 500,
];
$aPools[2] = [];
function array_flatten($aArray)
{
$aOut = array();
foreach ($aArray as $mSubItem)
{
if(is_array($mSubItem))
{
$aOut = array_merge($aOut, array_flatten($mSubItem));
}
else
{
$aOut[] = $mSubItem;
}
}
return $aOut;
}
print_r(array_flatten($aPools));