move demo documents into separate files

This commit is contained in:
Fabian Jakobs 2011-08-16 13:22:03 +02:00
commit 426259dc2f
23 changed files with 466 additions and 495 deletions

19
demo/docs/php.php Normal file
View file

@ -0,0 +1,19 @@
<?php
function nfact($n) {
if ($n == 0) {
return 1;
}
else {
return $n * nfact($n - 1);
}
}
echo "\n\nPlease enter a whole number ... ";
$num = trim(fgets(STDIN));
// ===== PROCESS - Determing the factorial of the input number =====
$output = "\n\nFactorial " . $num . " = " . nfact($num) . "\n\n";
echo $output;
?>