Re: [PHP] array_map() with multiple callback functions

2013-05-08 Thread Andrew Ballard
On Tue, May 7, 2013 at 5:43 PM, Alex Nikitin wrote: > On Tue, May 7, 2013 at 4:29 PM, George Langley wrote: >> Hi all. I want to apply strtolower() AND trim() to all items in an array. >> But I don't see a way to call multiple callbacks with the array_map() >> function. >> Are my two choices th

Re: [PHP] array_map() with multiple callback functions

2013-05-07 Thread Alex Nikitin
Something like: $cleanData = array_map(function($str){return strtolower(trim($str));}, $passedData); -- The trouble with programmers is that you can never tell what a programmer is doing until it’s too late. ~Seymour Cray On Tue, May 7, 2013 at 4:29 PM, George Langley wrote: > Hi all. I want t

[PHP] array_map() with multiple callback functions

2013-05-07 Thread George Langley
Hi all. I want to apply strtolower() AND trim() to all items in an array. But I don't see a way to call multiple callbacks with the array_map() function. Are my two choices the following: // 1) nesting two array_map() calls $cleanData = array_map('trim',(array_map('strtolower',$rawData))); // 2