-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathLecture 22.php
More file actions
45 lines (41 loc) · 892 Bytes
/
Copy pathLecture 22.php
File metadata and controls
45 lines (41 loc) · 892 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
42
43
44
45
<?php
echo 'Enter a number from 1-3';
extract($_POST);
$average =90;
$num = 2;
echo "<br> the entered number is $num";
switch ($num){
/*
{
case $average > 70:
$grade = 'A';
break;
case $average >= 60 && $average <= 69:
$grade = 'B';
break;
case $average >= 50 && $average <= 59:
$grade = 'C';
break;
default:
throw new Exception(sprintf('Unable to map average (%d) to a grade.', $average));
}
*/
case 1:{
echo "<br> This is Case 1";
echo "<br> ONE";
break;
}
case 2:{
echo "<br> This is Case 2 ";
echo "<br> TWO";
break;
}
case 3:{
echo "<br> This is Case 3 ";
echo "<br> THREE";
break;
}
default:
echo "<br> NO Match is Found";
echo "<br>Wrong Entry";
}