[Pugged] Function variable question
Chris Hettinger
ciapug@ciapug.org
Fri, 22 Nov 2002 20:28:37 -0600
Thanks all.
-----Original Message-----
From: ciapug-admin@ciapug.org [mailto:ciapug-admin@ciapug.org] On Behalf
Of Angie Tollerson
Sent: Friday, November 22, 2002 4:30 PM
To: ciapug@ciapug.org
Subject: Re: [Pugged] Function variable question
chris, this might help too, it's a slight variation of what Laith sent
you but is the way it's more commonly used function getfunky( $var1,
$var2, $var3 = ""){
if(!empty($var3){
do whatever
}
}
That's probably the practicality that most people would use. IF $var3
ends up having a value the null will get overridden just fine.
Angie Tollerson
Alliance Technologies Web Programmer
(515) 245-7628
tollerson@alliancetechnologies.net
>>> laith@prestonfam.org 11/22/02 11:41 AM >>>
At 10:29 AM 11/22/2002, you wrote:
>function getfunky($var1, $var2, $var3){
> // how to get funky
>}
>
>Q: $var3 is something that may not get used every time I use this
>function. I am curious how to make this variable optional?
function getfunky( $var1, $var2, $var3 = "*NOTUSED*"){
//how to get funky
// with code to ignore $var3 if == *NOTUSED*
}
or
function getfunky( $var1, $var2, $var3 = default){
//how to get funky
// where default == a default value
}
that ZEND thing was confusing to me...
Laith
_______________________________________________
Ciapug mailing list
Ciapug@ciapug.org
http://cialug.org/mailman/listinfo/ciapug
_______________________________________________
Ciapug mailing list
Ciapug@ciapug.org
http://cialug.org/mailman/listinfo/ciapug