-
Notifications
You must be signed in to change notification settings - Fork 0
/
contar.php
75 lines (63 loc) · 1.42 KB
/
contar.php
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
75
<?php
function contar($aArray) {
$contador = 0;
foreach ($aArray as $elemento) {
$contador++;
}
return $contador;
}
$aNotas = [9, 8, 9.5, 4, 7, 8];
$aProductos = [];
$aProductos[] = [
"nombre" => "Smart TV 55\" 4K UHD",
"marca" => "Hitachi",
"modelo" => "554KS20",
"stock" => 60,
"precio" => 58000
];
$aProductos[] = [
"nombre" => "Samsung Galaxy A30 Blanco",
"marca" => "Samsung",
"modelo" => "Galaxy A30",
"stock" => 0,
"precio" => 22000
];
$aProductos[] = [
"nombre" => "Aire Acondicionado Split F/C Surrey 2900F",
"marca" => "Surrey",
"modelo" => "553AIQ1201E",
"stock" => 5,
"precio" => 45000
];
$aPacientes = [];
$aPacientes[] = [
"dni" => "33.765.012",
"nombre" => "Ana",
"apellido" => "Acuña",
"edad" => 45,
"peso" => 81.5
];
$aPacientes[] = [
"dni" => "21.684.385",
"nombre" => "Gonzalo",
"apellido" => "Bustamante",
"edad" => 66,
"peso" => 79
];
$aPacientes[] = [
"dni" => "31.418.734",
"nombre" => "Juan",
"apellido" => "Irraola",
"edad" => 28,
"peso" => 65.4
];
$aPacientes[] = [
"dni" => "25.205.123",
"nombre" => "Beatriz",
"apellido" => "Ocampo",
"edad" => 50,
"peso" => 84.2
];
echo "Cantidad de notas: " . contar($aNotas) . "<br>";
echo "Cantidad de productos: " . contar($aProductos) . "<br>";
echo "Cantidad de pacientes: " . contar($aPacientes) . "<br>";