Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $n = 13;
- $r = $n % 2;
- switch ($r) {
- case 0:
- echo "{$n} is an even number";
- break;
- default:
- echo "{$n} is an odd number";
- }
- echo "<br/>";
- $color = 'red';
- switch ($color) {
- /*case 'red':
- echo "{$color} i like this color";
- break;
- case 'green':
- echo "{$color} i also like this color";
- break;*/
- case 'red':
- case 'green':
- echo ucwords($color)."is also like this color";
- break;
- case 'blue':
- echo "{$color} is dont like this color";
- break;
- default:
- echo "this color is ok";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement