[thelist] functions in PHP and arguments (was: PHP string tip...)
.jeff
jeff at members.evolt.org
Fri Aug 31 18:00:54 CDT 2001
joe,
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: Joe Crawford
>
> And how would I make a function with an arbitrary
> number of arguments? like in JavaScript where you
> can access a functioname.arguments[] array.
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
not a php guru by any means, but this is how i'd do it:
function myFunction($arguments)
{
// loop stuff and other expressions
}
then, create an array and pass that array to the function (dunno if i have
the syntax right for php).
$myArray = ['arg 1', 'arg 2', 'arg 3', 'arg 4'];
$myFunction($myArray);
good luck,
.jeff
http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/
More information about the thelist
mailing list