switch

    0

    5

    lucycodes42

    PHP recipes

    The code in the example will execute the code inside the case labelled label only if the condition is true. If the condition is false, the code will execute the code inside the case labelled default.

    Shortcut: switch

    switch ($cond) {
      case label:
        break;
      case label:
        break;
      case label:
        break;
      default:
    }
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    Legal
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.