Hello,
I'm trying to pass an unknown number of parameters to a function, have the function process the parameters, and return them as their original name (modify them globally). Here's what I have written, but it's not working.
function fnCleanInputVar(){
$numargs = func_num_args();
for ($i = 0; $i < $numargs; $i++ ) {
eval("global " . func_get_arg($i) . ";");
$argName = func_get_arg($i);
eval("\$argValue = \"$argName\";");
if(ereg(";", $argValue) == TRUE) {
List($argValue, $junk ) = split(";", $argValue);
eval("\$argName = \"$argValue\";");
}
}
}
I would call the function as follows:
fnCleanInputVar('$var1', '$var2', ...)
Thanks,
Eddie