[thelist] recursive PHP functions

Jay Blanchard jay.blanchard at niicommunications.com
Mon Sep 16 10:32:07 CDT 2002


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

There is no recursive() function in PHP, this is a self-defined function. If
$n is greater than 10 then the number will be incremented by one and then
returned. Is this what you want?

HTH!

Jay





More information about the thelist mailing list