Switch and constants : switch statement « Statement « PHP
- PHP
- Statement
- switch statement
Switch and constants
<?php
define('ALIGN_LEFT', 1);
define('ALIGN_CENTER', 2);
define('ALIGN_RIGHT', 3);
switch($value) {
case ALIGN_LEFT :
break;
case ALIGN_CENTER :
break;
case ALIGN_RIGHT :
break;
}
?>
Related examples in the same category