Re: FLAG

From: Date: Thu, 27 Nov 2003 07:09:05 +0000
Subject: Re: FLAG
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-171170@lists.php.net to get a copy of this message
* Thus wrote Ford, Mike [LSS] (M.Ford@lmu.ac.uk): > On 26 November 2003 12:43, Jay Blanchard contributed these pearls of wisdom: > > > [snip] > > Well, so is there any online resource whereby I can read up on > > "FLAG" ???Or any idea how should I go about creating the > > memory location to store the binary-ish information (e.g. > > true/false, yes/no, 1/0)? Hope to get some help soon...thnx. > > [/snip] > > > > You're not likely to find something specific on FLAG, but > > maybe the following demonstration can help.... > > > > <?php > > > > if("blue" == $sky){ > > $niceWeatherFLAG = TRUE; > > } else { > > $niceWeatherFLAG = FALSE; > > } > > And a better way of writing that (more concise, more efficient) is: > > $niceWeatherFLAG = ("blue" == $sky); that variable name has been bugging me (sorry jay :) Since a flag usually represents the answer to yes or no, I usually keep my variables names so they answer the question containing the flag: $is_nice_weather = ('blue' == $sky); $is_weekend = ($day != 'weekday'); $have_beer = (true != false); Curt -- "My PHP key is worn out" PHP List stats since 1997: http://zirzow.dyndns.org/html/mlists/

« previous php.general (#171170) next »