esercizi in php

This commit is contained in:
2014-10-25 15:24:01 +02:00
parent 8e3c635fd9
commit c318b09580
10 changed files with 448 additions and 0 deletions

48
php_1_3.php Normal file
View File

@@ -0,0 +1,48 @@
<?php
include ('header.html');
///////////////////////////
echo<<<_css
<style>
</style>
_css;
echo "\n";
///////////////////////////
for ($i=1;$i<=9;$i++){
echo "<p>\n";
echo "$i : " . fattoriale($i);
echo "</p>\n";
}
include ('footer.html');
function fattoriale ($input){
if ($input == 1){
return 1;
} else {
return (fattoriale($input -1 ) * $input);
}
}
?>