Have a 'function use' lesson problem. The code inside the function (when it's put outside the function; returns an array) seems correct, but the function outputs NULL. Here's what it looks. Point where I'm doing wrong, please.
function getDivisors($num)
{
for ($i=1; $i<=$num; $i++)
{
if ($num % $i == 0)
{
$divisors[] = $i;
}
}
}
I suppose the output to the array is an incorrect, but... that's still unsure.
returnthe array from the function