Having the following code:
switch ($options['algorythm'])
{
case 'jigsaw':
$result = $this->jigsaw($options['count'], $options['length']);
break;
case 'freddy':
$result = $this->freddy($options['count'], $options['length'], $options['characters']);
break;
}
for($i=0; $i < $options['count']; $i++)
{
echo $result."<br/>";
}
How can I execute the function inside $result the times defined in count? Because as for now, it will only repeat the same result that many times.
The simplest way would be to move your
switchinside your loop:After that’s working, you can try being clever with
call_user_func.