NYCPHP Meetup

NYPHP.org

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

robyn o robynover at gmail.com
Fri Oct 14 14:25:56 EDT 2005


i think func_get_args() is what i need -- thank you.

(i don't want pass an array into the function in this case, because i want
to deal with each item separately later in the function.)


On 10/14/05, Michael Sims <jellicle at gmail.com> wrote:
>
> 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
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20051014/0ba0d1d8/attachment.html>


More information about the talk mailing list