Hello raisinlove,

Monday, March 29, 2004, 4:21:44 PM, you wrote:

r> Hi, I'm looking for a concrete example I could use to create an array
r> where each element from an original array is processed by a function.

r> It seems array_walk would be the solution but it doesnt seem to output
r> an array.

r> My function looks up my array elements in a mysql table and outputs a
r> corresponding row value. So I would like my new array to be made up of
r> these values.

array_walk should be fine for this, instead of creating a new array
why not just modify the existing one? I.e.:

function the_function (&$item)
{
         $item = whatever_cleaning_you_need_to_do();
}

array_walk($your_array_to_tidy, 'the_function');

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to