-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path10.php
More file actions
43 lines (36 loc) · 936 Bytes
/
10.php
File metadata and controls
43 lines (36 loc) · 936 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
<?php // Loop FOREACH
$transp = array("Carro", "Moto", "Bicicleta", "Onibus", "Avião");
foreach($transp as $veiculo)
{
echo "$veiculo<br/>";
/*
if($veiculo == "Bicicleta")
{
break;
} */
}
echo "<hr/>";
foreach ($transp as $veiculo)
{
if($veiculo == "Bicicleta")
{
echo "Bicicleta esta na lista de veiculos<br/>";
break;
}
if($veiculo == "Avião")
echo "Avião esta na lista de veiculos<br/>";
if($veiculo == "trem")
echo "Trem esta na na lista de veiculo<br/>";
}
?>
<!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>10 aula de PHP - loop FOREACH</title>
</head>
<body>
</body>
</html>