Re: switch case madness

From: Date: Wed, 19 Jan 2011 03:37:47 +0000
Subject: Re: switch case madness
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-310850@lists.php.net to get a copy of this message
On Jan 18, 2011, at 10:30 PM, Donovan Brooke 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 I use switch cases so rarely I would have to refer you to the documentation. Regards, -Josh ____________________________________ Joshua Kehn | Josh.Kehn@gmail.com http://joshuakehn.com

« previous php.general (#310850) next »