note 40065 deleted from language.functions by tomsommer
| From: | tomsommer@php.net | Date: | Sun, 27 Jun 2004 02:09:07 +0000 |
| Subject: | note 40065 deleted from language.functions by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-71845@lists.php.net to get a copy of this message | ||
Note Submitter: michielATnetural.nl
----
Took me a while to figure this out.
If you want a function to have a optional variable you just add = VALUE so it would look like this:
<?php
function foo($foo, $bar = "bar")
{
echo $foo.$bar;
}
echo foo("foo");
//gives: foobar
echo foo("foo","bar2");
//gives foobar2
?>