note 56534 modified in function.func-num-args by danbrown
| From: | danbrown@php.net | Date: | Sat, 19 Jul 2008 21:52:45 +0000 |
| Subject: | note 56534 modified in function.func-num-args by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-141770@lists.php.net to get a copy of this message | ||
Just a note for anyone wondering. This function doesn't include params that have a default
value, unless you pass one in to overwrite the default param value. Not sure if that makes sense, so
here's an example:
<?php
function helloWorld($ArgA, $ArgB="HelloWorld!") {
return func_num_args();
}
// The following will return 1
$Returns1 = helloWorld("HelloWorld!");
// The following will return 2
$Returns2 = helloWorld("HelloWorld!", "HowdyWorld!");
?>
--was--
Just a note for anyone wondering. This function doesn't include params that have a default
value, unless you pass one in to overwrite the default param value. Not sure if that makes sense, so
here's an example:
function helloWorld($ArgA, $ArgB="HelloWorld!") {
return func_num_args();
}
// The following will return 1
$Returns1 = helloWorld("HelloWorld!");
// The following will return 2
$Returns2 = helloWorld("HelloWorld!", "HowdyWorld!");
http://php.net/manual/en/function.func-num-args.php