Ok, so if an argument is supplied to the function, the "= null" is
ignored?

Jeff
> -----Original Message-----
> From: Brad Pauly [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, September 25, 2003 4:09 PM
> To: Jeff McKeon
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Understanding code.. again
> 
> 
> Jeff McKeon wrote:
> > Function Showmessage($msgvar = null)
> > {
> >     echo $msgvar;
> > }
> > ?>
> > --snip--
> > 
> > What is the purpose in the function def of "($msgvar = 
> null)"??  Why 
> > not just "function showmessage($msgvar)"??
> 
> That sets a default value for $msgvar so you can call the function 
> without an argument and it will not raise an error.
> 
> - Brad
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to