Yes I googled this, but I could not find anything. Here is my function that is in a class:
My problem is that I want to replace each argument from the originalPHP Code:public function create()
{
$args = func_get_args();
$element = $args[0];
if(isset($this->elements->$element)) {
$value=$this->elements->$element;
unset($args[0]);
$format = implode(", ", $args);
printf($value, $format);
return true;
}
else {
return false;
}
}
create()function intoprintf.$this->elementscontains an object with formatted elements, ready forprintf. I have gotten this to work with one argument, but some elements require multiple ones. How do I pass an array into arguments that a function will read each as it's own argument?



Reply With Quote

Bookmarks