1
0
mirror of https://github.com/php/web-php.git synced 2026-03-24 07:12:16 +01:00
Files
archived-web-php/apachecon/s_function.php3
Rasmus Lerdorf 2424277ad8 Add main slides
1998-10-21 23:44:28 +00:00

27 lines
591 B
PHP
Executable File

<?php require "header.inc"?>
<H1>Functions</H1>
<?example('<?function log_data($user, $data) {
mysql_query("INSERT INTO userdata VALUES (\'".
uniqid()."\', \'$user\', \'$data\')");
}?>');?>
<H4>Pass-by-reference</H4>
<?example('<?function sum_array(const $input) {
while (list(,$value) = each($input)) {
$total += $input;
}
return $total;
}?>');?>
<H4>Default values</H4>
<?example('<?function pageheader($title = "Default Title") {?>
<HTML><HEAD><TITLE>
<?echo $title?>
</TITLE></HEAD><BODY>
<?}?>');?>
<?php require "footer.inc"?>