some stuff for the chapter on functions

This commit is contained in:
Dan Buch 2010-12-30 13:50:34 -05:00
parent 9dab7bf8d7
commit da075b76ba

View File

@ -0,0 +1,30 @@
<?php
require_once("_head.php");
mkheader("functions!", "#fafafa");
?>
<body>
<!-- ======================================================= -->
<pre><?php
function sum($this, $other=5) {
return $this + $other;
}
print "I am human, I am.\n";
$a = $_GET['a'] ? $_GET['a'] : 72 ;
print "$a plus 5 is " . sum($a, 5) . ".\n";
print "$a plus 5 is " . sum($a) . ".\n";
?></pre>
</body>
</html>