Closed. This question needs to be more
focused. It is not currently accepting answers.
Answer
Solution:
I finally got it..
private function flattenArray($array)
{
$objTmp = (object)['aFlat' => []];
array_walk_recursive($array, function(&$v, $k, &$t){$t->aFlat[] = $v;}, $objTmp);
return $objTmp->aFlat;
}
Source