define (true/false)
| From: | Sebastian | Date: | Wed, 27 Jul 2005 21:17:43 +0000 |
| Subject: | define (true/false) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-219459@lists.php.net to get a copy of this message | ||
i never really used constants before so this may sound stupid..
when you define a constant using define() and want to return true/false is this logical:
if($bars == 3)
{
define('BAR', 1);
}
then:
if(BAR)
{
// bars is true
}
or should i need to do an else statement as well:
if($bars == 3)
{
define('BAR', 1);
}
else
{
define('BAR', 0)
}
lastly is it more practical to just do:
if($bars == 3)
{
$bar = true;} i am curious what most people would use. -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.338 / Virus Database: 267.9.5/58 - Release Date: 7/25/2005