note 117035 deleted from functions.arguments by tularis
| From: | tularis@php.net | Date: | Mon, 06 Apr 2015 10:03:24 +0000 |
| Subject: | note 117035 deleted from functions.arguments by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-202172@lists.php.net to get a copy of this message | ||
Note Submitter: linzehuazuishuai at 163 dot com
----
array() can use as default value,too.
for example:
<?php
function echoArray($myarr = array("firstname"
=>"dear","lastname"=>"girl"))
{
var_dump($myarr);
}
echoArray();
$myarr =
array("firsstname"=>"hello","lastname"=>"world");
echoArray($myarr);
?>
get this output:
array (size=2)
'firstname' => string 'dear' (length=4)
'lastname' => string 'girl' (length=4)
array (size=2)
'firsstname' => string 'hello' (length=5)
'lastname' => string 'world' (length=5)