Jump to content

Quick question about switches


Michdd

Recommended Posts

You have to switch on the value "true":

<?php
switch (true) {
   case $range <= 30 && $range >= -30:
      //do this
   break;
?>

 

Ken

 

I have a question, I think I can do what I want to do another way, but I have 1 question.

 

If I have an if statement with an elseif clause, and say the first one holds true, will it go onto the elseif?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.