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

Home » Imported messages » comp.lang.php » switch with range of comparisons
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: switch with range of comparisons [message #184641 is a reply to message #184636] Tue, 14 January 2014 01:26 Go to previous messageGo to previous message
Doug Miller is currently offline  Doug Miller
Messages: 171
Registered: August 2011
Karma:
Senior Member
richard <noreply(at)example(dot)com> wrote in news:19ycnlnq3bdux$.jp8vxofzg98i.dlg@
40tude.net:

> switch ($value){
>
> case "A">="Z";
>
>
> }
>
> Would this be allowed?

Yes, it's allowed.

It's equivalent to

switch ($value) {
case false:
....
}

> What I want to do is to have one case for all 26 letters of the alphabet
> without having to use ||.

That won't do what you want. Neither will ||, for reasons that have already been explained.

Why not just code a simple if statement to test if $value is between "A" and "Z" ?
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: When a random file is not found then what?
Next Topic: [CM] Falkvinge: MtGox had custom SSHD written in PHP
Goto Forum:
  

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

Current Time: Mon Sep 30 06:14:12 GMT 2024

Total time taken to generate the page: 0.04776 seconds