34,333
edits
Changes
→Function Parameter Initialization
<pre>
function names ($firstname = "Not Specified", $lastname = "Unknown")
{
"First name is $firstname"
"Last name is $lastname"
}
</pre>
When executed with insufficient parameters, the default value is values are assigned:
<pre>
PS C:\Users\Administrator> names
First name is Not Specified
Last name is Unknown
PS C:\Users\Administrator> names john
First name is john
Last name is Unknown
</pre>