Should I ever use continue inside a switch statement?

Try using continue 2 to continue to the next iteration of the loop surrounding the switch statement.

EDIT:

    $foo = 'Hello';

    for ($p = 0; $p < 8; $p++) {
         switch($p) {
             case 3:
                 if ($foo === 'Hello') {
                     echo $foo;
                     break;
                 } else {
                      continue 2;
                 }

             default:
                 echo "Sleeping...<br>";
                 continue 2;

         }

         echo "World!";
         break;
    }

//This will print:
Sleeping...
Sleeping...
Sleeping...
Hello World!

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)