NYCPHP Meetup

NYPHP.org

[nycphp-talk] all functions parameters in an array?

Michael Sims jellicle at gmail.com
Fri Oct 14 14:19:35 EDT 2005


On Friday 14 October 2005 14:10, robyn o wrote:

> For example, I have several strings in a function, and I'd like to do
> the same thing to all of them before I deal with them individually:
>
> function my_function($a, $b, $c, $d){
> foreach ($array_of_parameters as $p){
> $p = trim($p);
> }
> }

A few notes:
--see the func_get_arg() and func_get_args() functions
--see the array_map() function
--remember a function can take an array as a parameter (which isn't 
necessary, given the above functions I noted, but may be easier)


Michael Sims



More information about the talk mailing list