FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » switch with case 0
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: switch with case 0 [message #182592 is a reply to message #182590] Sat, 17 August 2013 07:51 Go to previous messageGo to previous message
Luuk is currently offline  Luuk
Messages: 329
Registered: September 2010
Karma:
Senior Member
On 17-08-2013 08:35, J.O. Aho wrote:
> You can try this one:
>
> switch("123") {
> case 0:
> echo "it's 0\n";
> break;
>
> case 123:
> echo "it's 123\n";
> break;
>
> default:
> echo "it's NOT 0 nor 123\n";
> }

or:

You can try this one:

switch("1e3") {
case 0:
echo "it's 0\n";
break;

case 1000:
echo "it's 1000\n";
break;

default:
echo "it's NOT 0 nor 1000\n";
}
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: AND and OR
Next Topic: Compiling PHP 5.x on Cygwin
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 11:25:39 GMT 2024

Total time taken to generate the page: 0.04204 seconds