Re: Best method of doing simple flags
From: Alvaro G. Vicario (kAlvaroNOSPAMTHANKS_at_terra.es)
Date: 09/18/04
- Previous message: Alvaro G. Vicario: "Re: There must be a better way to write this"
- In reply to: harryman100: "Best method of doing simple flags"
- Next in thread: Berislav Lopac: "Re: Best method of doing simple flags"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 18 Sep 2004 15:20:41 +0200
*** harryman100 escribió/wrote (18 Sep 2004 06:05:55 -0700):
> $something_flag = 1;
>
> then later on in the script:
>
> if ($something_flag) {
> do_something();
> }
>
> Is this the best way of doing simple yes/no tests in PHP, or is there
> another way I haven't discovered yet?
Using TRUE or FALSE instead of 1 and 0 is almost the same, but slightly
clearer. Other than that, I see nothing wrong in your method.
-- -+ Álvaro G. Vicario - Burgos, Spain +- http://www.demogracia.com (la web de humor barnizada para la intemperie) ++ Las dudas informáticas recibidas por correo irán directas a la papelera -+ I'm not a free help desk, please don't e-mail me your questions --
- Previous message: Alvaro G. Vicario: "Re: There must be a better way to write this"
- In reply to: harryman100: "Best method of doing simple flags"
- Next in thread: Berislav Lopac: "Re: Best method of doing simple flags"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|