-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswitchcase.php
More file actions
74 lines (61 loc) · 1.25 KB
/
switchcase.php
File metadata and controls
74 lines (61 loc) · 1.25 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<?
/* $myAge = 3;
if( $myAge == 1 )
{
print "1 year olds go in room 111";
}
else if( $myAge == 2 )
{
print( "2 year olds go in room 85" );
}
else if( $myAge == 3 )
{
print( "3 year olds go in room 76" );
}
else if( $myAge == 4 )
{
print( "4 year olds go upstairs" );
}
else if( $myAge == 5 )
{
print( "5 year olds go in the green office." );
}
else
{
print( "Sorry that child is too old." );
}
*/
$myAge = 9;
switch( $myAge )
{
case 1: print( "1 year olds go in room 111" );
break;
case 2: print( "2 year olds go in room 55" );
break;
case 3: print( "3 year olds go in room 76" );
break;
case 4: print( "4 year olds go upstairs." );
break;
case 5: print( "5 year olds go in the green office." );
break;
/* case 6:
case 7:
case 8:
case 9:
case 10: print( "kids 6 thru 10 can go play in the gym." );
break;
*/
case $myAge >= 6 || $myAge <= 10: print( "kids 6 thru 10 can go play in the gym." );
break;
default: print( "Sorry that child is too old." );
break;
}
?>
</body>
</html>