Re: [PHP] array_walk_recursive pass by reference

2010-08-29 Thread Adam Richardson
On Sun, Aug 29, 2010 at 12:35 AM, kranthi wrote: > i have an array > $parms = array('1' => 'a', 'b' => array(3 => 'test')); > i want $mail = '1:a 3:test'; > But you're uppercasing and adding new lines and additional spaces, so I hope you want (at least, this is what I tested against): "1: A\n3:

[PHP] array_walk_recursive pass by reference

2010-08-28 Thread kranthi
i have an array $parms = array('1' => 'a', 'b' => array(3 => 'test')); i want $mail = '1:a 3:test'; array_walk_recursive($parms, function($val, $key, &$mail) {     $mail .= ucwords($key) . ': '. ucwords($val) . "\n"; }, &$mail); The above function worked perfectly well but i am getting: Call-time