I have two functions with an optional amount of variables:
function getTexts()
{
$this->printTextToDashboard();
}
function printTextToDashboard()
{
$args = func_get_args();
$argsNum = count($args);
for($i=0; $i < $argsNum; $i++)
{
echo "This is the $i text: "."<br />".$args[$i]."<br />";
}
}
For instance I want to call getTexts like this:
getTexts($name, $lastname, $email);
I know it has something to do with user_func_* , but I'm unable to implement it.
Thanks in advance