Re: how do i give optional arguments to functions??
| From: | Richard S. Crawford | Date: | Wed, 24 Oct 2001 17:14:17 +0000 |
| Subject: | Re: how do i give optional arguments to functions?? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-72124@lists.php.net to get a copy of this message | ||
function top ($image) {
if ($image) echo "blah blah blah";
else echo "blah blah $image blah";
}
There's probably a more efficient way to do it.
At 09:57 AM 10/24/2001, sunny AT wde wrote:
hi all!! i'm writing functions like - ------- function top () { echo "blah blah blah";} ------- what i want to do is make it so that i can do - ------- function top($image) { echo "blah blah $image blah"; } ------- but also make the $image parameter in the top() as optional. so if its not there, then tell php not to worry about it. any ideas?? thanks! sunny __________________________________________________ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.netSliante, Richard S. Crawford http://www.mossroot.com mailto:rscrawford@mossroot.com AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford "It is only with the heart that we see rightly; what is essential is invisible to the eye." --Antoine de Saint Exupéry "Push the button, Max!"