Jump to content

[SOLVED] dynamic function arguments


taith

Recommended Posts

trying to pass dynamic function arguments from one function into another...

 

<?
function f($f){
$a=func_get_args();
unset($a[0]);
return $f(implode(', ',$a));
}

for($i=0; $i<20; $i++){
echo '<br>'.f(rr,'0'.rand(1,99999),4);
}
?>

 

which works all well and good... however, the ,4 is added onto the $a as tho it were part of the same string, and i want it segregated(second argument in my rr function).... any ideas?

 

that'd output somin like

 

012195, 4
018554, 4
061523, 4
043335, 4
022405, 4
095647, 4

Link to comment
https://forums.phpfreaks.com/topic/88829-solved-dynamic-function-arguments/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.