Re: Variable number of parameters

From: Date: Tue, 05 Aug 2008 15:36:06 +0000
Subject: Re: Variable number of parameters
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-277727@lists.php.net to get a copy of this message
Philip Thompson wrote: >> .... but more likely, you're looking for func_get_args(). >> >> http://php.net/func_get_args > > Fortunately, I am quite familiar with your example. However, I am more > looking for something in which I could send any number of parameters > to my own function, grab each one of those individually, and then send > them each to another built-in function. But isn't that *exactly* what func_get_args() allows you to do: 1. send any number of arguments to your own function - check! 2. grab each one of those individually - check! 3. send them each to <where ever> - check! > Basically, I want to avoid hard-coding this. On top of looking ugly, > it's bad practice. > [smip] > Alas, I feel I must take a different approach to solve this problem. What exactly _is_ the problem you're trying to solve? /Per Jessen, Zürich

« previous php.general (#277727) next »