Re: switch case madness

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



$t_mssg = 0 is different from $t_mssg = "0" (in all languages, as far as I
know, maybe not in python, but I don't know python)

On Tue, Jan 18, 2011 at 10:30 PM, Donovan Brooke <lists@xxxxxxx> wrote:

> Hello,
>
> I must not understand PHP's switch/case..
> The case '0' below fires when $t_mssg = "" apparently.
> Is this how it's suppose to work? I would think
> it would only fire if it equaled "0".
>
> ----------
> print "-$t_mssg- <br />";
>
> if (isset($t_mssg)) {
>  switch ($t_mssg) {
>    case 0:
>      echo '<p><span style="color:red;">Log In Successful</span></p>';
>      break;
>  }
> }
> ----------
>
> TIA,
> Donovan
>
> --
> D Brooke
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Mujtaba

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux