[thelist] recursive PHP functions

Roger Ly rogerly at bareviking.com
Mon Sep 16 10:52:01 CDT 2002


[snip]
function recursive ($n)
 {
    if ($n > 10) return $n;
        $n++;
        recursive ($n);
 }
echo "The result:".rec1(1)."<br>";
[/snip]

You need to change the last line in the function recursize to

return recursive ($n);

The function isn't actually returning anything in the first case.

Roger



More information about the thelist mailing list