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 #184638 is a reply to message #184636] Tue, 14 January 2014 00:14 Go to previous messageGo to previous message
Scott Johnson is currently offline  Scott Johnson
Messages: 196
Registered: January 2012
Karma:
Senior Member
On 1/13/2014 3:35 PM, richard wrote:
> switch ($value){
>
> case "A">="Z";
>
>
> }
>
> Would this be allowed?
>
> What I want to do is to have one case for all 26 letters of the alphabet
> without having to use ||.
>

Why don't you venture into the if()..elseif() schema.

Or...

have 26 cases that just drop thru to the last one that does the processing.

This was you can eventually add needed code for the ones that need it.

Scotty
[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: Thu Nov 28 12:04:44 GMT 2024

Total time taken to generate the page: 0.04431 seconds