forked from marcosrivasr/Curso-PHP-MySQL
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path06 arreglos.php
More file actions
46 lines (31 loc) · 738 Bytes
/
06 arreglos.php
File metadata and controls
46 lines (31 loc) · 738 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
46
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Arreglos</title>
<style>
body{background-color: #B5CDE6; font-family: Arial; font-size: 4em; padding: 50px;}
</style>
</head>
<body>
<?php
$frutas = array("platano", "manzana", "uvas", "fresa");
print_r($frutas);
echo $frutas[3];
echo "<br >";
echo count($frutas) . " elementos";
echo "<br >";
for($i= 0; $i < count($frutas); $i++){
echo $frutas[$i] . "<br />";
}
$edades = array("Marcos" => 34, "Tania" => 23, "Omar" => 27);
print_r($edades);
echo "<br >";
echo $edades['Tania'];
echo "<br >";
foreach($edades as $key => $value){
echo $key . " tiene el valor de " . $value . "<br />";
}
?>
</body>
</html>