-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path6.php
More file actions
55 lines (48 loc) · 1.12 KB
/
6.php
File metadata and controls
55 lines (48 loc) · 1.12 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
<?php //switch case
$opc = 2; //1:Carro, 2:Moto, 3:Bicicleta, 4:Navio, 5:Avião
switch ($opc)
{
case 1:
echo "Carro";
break;
case 2:
echo "Moto";
break;
case 3:
echo "Bicicleta";
break;
case 4:
echo "Navio";
break;
case 5:
echo "Avião";
break;
default;
echo "Transpote invalido";
break;
}
echo "<hr/>";
switch ($opc)
{
case ($opc <= 3 and $opc > 0);
echo "Transporte terrestre";
break;
case 4:
echo "Transporte maritimo";
break;
case 5:
echo "Transporte aereo";
break;
}
?>
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>6 aula de PHP - switch case</title>
</head>
<body>
</body>
</html>