Re: [PHP] Why is this array_walk_recursive action not working? [SOLVED]

2011-02-25 Thread Dave M G
Feln, Richard, Jim, Thank you for responding. I understand now that the problem wasn't with variable scope, but with my lack of understanding of what array_walk_recursive returns. Thank you all for your explanations. -- Dave M G -- PHP General Mailing List (http://www.php.net/) To unsubscrib

Re: [PHP] Why is this array_walk_recursive action not working?

2011-02-24 Thread Jim Lucas
On 2/24/2011 3:01 AM, Dave M G wrote: > PHP users, > > I obviously don't understand what array_walk_recursive does. > > Can someone break down in simple terms why the following doesn't work? > > - - - > > $karamohOutput['test'] = ""; > > function test_print($item, $key) > { > return "$key

Re: [PHP] Why is this array_walk_recursive action not working?

2011-02-24 Thread Richard Quadling
On 24 February 2011 15:15, Dave M G wrote: > FeIn, > > Thank you for responding. > > >> what did you expect to happen when you call array_walk_recursive? > > > What I don't understand is why it did not append to the string as it > walked through each key/value pair. > > It seems like even though t

Re: [PHP] Why is this array_walk_recursive action not working?

2011-02-24 Thread FeIn
Hi, Well, first array_walk_recursive returns a boolean so what you are doing in you script is append a boolean (true or false) that will be converted to string. So if array_walk_recursive will return true you will have the string "1" in $karamohOutput['test'], and if array_walk_recursive will retu

Re: [PHP] Why is this array_walk_recursive action not working?

2011-02-24 Thread Dave M G
FeIn, Thank you for responding. > what did you expect to happen when you call array_walk_recursive? What I don't understand is why it did not append to the string as it walked through each key/value pair. It seems like even though the variable inside the function called by array_walk_recursiv

Re: [PHP] Why is this array_walk_recursive action not working?

2011-02-24 Thread FeIn
Hi, How does the input array look like (the contents of the $karamohArray variable) ? Is your script generating any errors? What do you expect to happen when you call array_walk_recursive? On Thu, Feb 24, 2011 at 1:01 PM, Dave M G wrote: > PHP users, > > I obviously don't understand what array_

[PHP] Why is this array_walk_recursive action not working?

2011-02-24 Thread Dave M G
PHP users, I obviously don't understand what array_walk_recursive does. Can someone break down in simple terms why the following doesn't work? - - - $karamohOutput['test'] = ""; function test_print($item, $key) { return "$key holds $item\n"; } $karamohOutput['test'] .= array_walk_recursive