Re: define() an array?

From: Date: Fri, 20 Apr 2007 20:27:53 +0000
Subject: Re: define() an array?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-253375@lists.php.net to get a copy of this message
On Fri, April 20, 2007 4:46 am, lists@dwsasia.com wrote: > I thought I could define() and array. However, when I do this: Nope. :-( Has to be string or int or boolean or float or other "scalar" type. > define("THECONSTANT", array(1,2,3)); > print_r(THECONSTANT); > > it prints THECONSTANT and not the array :( > > according to the manual: > > bool define ( string $name, mixed $value [, bool $case_insensitive] ) > > And isn't "mixed" of any type? No. "mixed" just means it's 2 or more types. There could be all kinda of reasons/cases where "mixed" means only scalars, or only compound types or, really, any 2 types you'd care to choose. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?

« previous php.general (#253375) next »