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
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
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
Yes the null is ignored when a var is passed
-- SNIP--
Ok, so if an argument is supplied to the function, the = null is
ignored?
Jeff
-- snip --
chris
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Jeff McKeon wrote:
Ok, so if an argument is supplied to the function, the = null is
ignored?
Yep.
- Brad
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Thanks all!
Jeff
-Original Message-
From: Chris Sherwood [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 25, 2003 4:15 PM
To: Jeff McKeon; [EMAIL PROTECTED]
Subject: Re: [PHP] Understanding code.. again
Yes the null is ignored when a var is passed
-- SNIP--
Ok, so
6 matches
Mail list logo