Re: Best method of doing simple flags

From: Alvaro G. Vicario (kAlvaroNOSPAMTHANKS_at_terra.es)
Date: 09/18/04

  • Next message: Berislav Lopac: "Re: Best method of doing simple flags"
    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
    --
    

  • Next message: Berislav Lopac: "Re: Best method of doing simple flags"

    Relevant Pages

    • Re: [PHP] PHP console script vs C/C++/C#
      ... My script is taking a longer time to execute than I want. ... I prefer to write in PHP because that is what I know best. ... This is why I am thinking about rewriting my whole script in a C language. ... Perhaps there are different methods I could be using to speed up execution. ...
      (php.general)
    • Re: How to Add a Feeback Form
      ... I saw nothing in that script that indicates where the form is e-mailed to so ... Greg Maxey/Word MVP ... PHP or not. ... have the support available yet. ...
      (microsoft.public.frontpage.programming)
    • Email form script
      ... I have a web form that posts to a .php ... who cannot run .php on their server. ... Or does anyone have a .asp script that will ... Thank you for choosing FormToEmail by FormToEmail.com ...
      (microsoft.public.scripting.jscript)
    • Re: [PHP] PHP console script vs C/C++/C#
      ... My script is taking a longer time to execute than I want. ... I prefer to write in PHP because that is what I know best. ... thinking about rewriting my whole script in a C language. ... execution of the code. ...
      (php.general)
    • NOCC Webmail <= 1.0 multiple vulnerabilities
      ... "NOCC is a webmail client written in PHP. ... remote code execution, there are two ways of execute arbitrary code on ... is defined in conf.php, by default no path is defined, but script suggests ... echo nl2br); ...
      (Bugtraq)