Hi all,
I have a multidimentional array that i need converting to a single array on the fly.
to do this i use the following function.
I need it to be changed to return the key name rather than setting it to a value
function array_values_recursive($ary) {
$lst = array();
foreach( array_keys($ary) as $k ) {
$v = $ary[$k];
if (is_scalar($v)) {
$lst[] = $v;
} elseif (is_array($v)) {
$lst = array_merge($lst,array_values_recursive($v));
}
}
return $lst;
}