Re: apply function to each array element?

From: Date: Mon, 29 Mar 2004 16:39:08 +0000
Subject: Re: apply function to each array element?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-181679@lists.php.net to get a copy of this message
Thanks for the reply, I think I'll need to dig deeper as the proposed line doesnt work with my function.
array_walk should be fine for this, instead of creating a new array why not just modify the existing one? I.e.:
The reason I want a new array is that I will then combine both together, for key/value pairs. The original array is a list of directories. My database contains data for each directory and in this case I want to create an array of the "title" for each directory that is included in the original array. So the final combined array would become something like: array('img_files'=>'The Images','some_stuff'=>'Some Stuff'...) I then generate the sub-directory menus of each of my directories with arrays like this.

« previous php.general (#181679) next »