-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswitchcase2.php
More file actions
41 lines (32 loc) · 808 Bytes
/
switchcase2.php
File metadata and controls
41 lines (32 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<?
$musician = "pete";
$formattedMusician = strtolower( $musician );
switch( $formattedMusician )
{
case "john": print( "John plays acoustic guitar." );
break;
case "paul": print( "Paul plays bass guitar." );
break;
case "eric":
case "george": print( ucfirst( $formattedMusician ) . " plays electric guitar." );
break;
case "pete":
case "ringo":
if( $formattedMusician == "pete" )
{
print( "Fun fact: Pete was better looking than Paul and John.<br>" );
}
print( ucfirst( $formattedMusician ) . " plays drums." );
break;
default: print( "That is not a Beatle." );
break;
}
?>
</body>
</html>