user defined functions: infinite arguments?<

liunx

Guest
does anyone know if it is possible to have a user defined function where the user can pass as many arguments as they want, and an action done for each argument?
something like

echoThemAll("bob", "rawr", "asdasd", etc, etc);

and the function echos each argument passed with <br /> appended to it? im want to make a function that lets the person have as many arguments as they want and it adds text on the beginning and end of it and then appends that to a larger string. is something like this possible?from
<!-- m --><a class="postlink" href="http://ca2.php.net/manual/en/functions.php">http://ca2.php.net/manual/en/functions.php</a><!-- m -->



PHP 3 does not support variable numbers of arguments to functions, although default arguments are supported (see Default argument values for more information). PHP 4 supports both: see Variable-length argument lists and the function references for func_num_args(), func_get_arg(), and func_get_args() for more information.thanks!
 
Back
Top