BACKGROUND: The following routine takes a nested, associative array whose end-values are empty, extracts the keys of each non-recursive subarray, and properly echoes each. Rather, than returning the result as a newly constituted array, however, the function returns boolean true and displays the desired result in a non-useable form.
Now, I have tried in vain to get the call-back function to produce an index-array of the echoed values that I can use outside the scope of the array_walk_recursive( ) function, but have failed miserably.
QUESTION: How does one produce from the function a useable array that can be used outside of the function.
$result = array_walk_recursive($insertion_vars, function($key, $value) {
echo $value . '<br />';
});