Recursive Functions are functions that auto-call themself. Generally, a recursive function returns a value that are passed as argument, so the value is passed from an auto-call to the other, until it is returned.
Recursive functions are very useful in equations with factorial numbers and some operatios with multi-dimensional array.
Factorials are written like 6! and this means: 6 * 5 * 4 * 3 * 2 * 1. So 6! is 4320 and 4! is 24.
In the fallowing example we have a recursive function that finds the factorial of a number "$nr" (here 8).
<?php // this function auto-calls itself (decrementing $nr) until $nr is 0 function factorial($nr) { if($nr > 0) $re = $nr * factorial($nr-1); else if($nr == 0) $re = 1; return $re; } echo '8 factorial is: '. factorial(8); // 8 factorial is: 45360 ?>
<embed src="flash_game.swf" width="450" height="350" />
#id:first-line { font-weight: bold; color: blue; }
var url = window.location; alert(url);
$homepage = file_get_contents("http://coursesweb.net/"); echo $homepage;