PHP endswitch Keyword

❮ PHP Keywords

Example

Close a switch conditional block:

<?php
$a = 4;
switch($a):
  case 1: echo "One"; break;
  case 2: echo "Two"; break;
  case 3: echo "Three"; break;
  default: echo "Many"; break;
endswitch;
?>
Try it Yourself »

Definition and Usage

The endswitch keyword is used to mark the end of a switch conditional which was started with the switch(...): syntax.


Related Pages

The switch keyword.

Read more about the switch statement in our PHP switch Statement Tutorial.


❮ PHP Keywords
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.