Re: Understanding code.. again

From: Date: Thu, 25 Sep 2003 20:10:13 +0000
Subject: Re: Understanding code.. again
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-163989@lists.php.net to get a copy of this message
Jeff McKeon said the following on 9/25/2003 4:00 PM>>
In the following code... --snip-- <?PHP $name = "bob"; Showmessage("hello $name"); Exit; Function Showmessage($msgvar = null) { echo $msgvar; } ?> --snip-- What is the purpose in the function def of "($msgvar = null)"?? Why not just "function showmessage($msgvar)"??
It's to set a default value if no argument is passed to the function when called like Showmessage(); In this case $msgvar inside the function will have a null value. HTH R'twick

« previous php.general (#163989) next »