|
Posted by amygdala on 12/17/84 11:55
Hi again,
Thanks for taking the time again to help me out. Much appreciated. I'm
pretty new to PHP so I'm exploring the possibilities of the language a bit.
Here's my problem:
I would like to iterate through arguments passed to a function, modify them
but still let them hold there original name. To be precise: I want users to
fill in a register form and once submitted, trim() all field values after
being passed to the function register().
Maybe my effort so far will clear it up even more:
// original list of arguments is quite longer
function register( $firstname, $lastname, $birthdate )
{
// loop through all arguments and modify them by reference
// someting like:
foreach( func_get_args() as $key => $value )
{
$key = trim( $val );
}
// echo trimmed argument $firstname
echo $firstname;
}
Is that possible?
Cheers
Navigation:
[Reply to this message]
|