-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathej3.php
47 lines (34 loc) · 975 Bytes
/
ej3.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
<?php
//ejemplo de arreglo en php
$arreglo =array(1,2,3,4,"texto",true);
print_r($arreglo);
echo "<br/>";
$arreglo2 =array("nombre" => "fulano",
"apellido" => "de tal",
"edad" => 20);
print_r($arreglo2);
echo "<br/>";
$arreglo2[]="esto tiene llave";
$arreglo2["titulo"]="sr";
print_r($arreglo2);
echo "<br/>";
$personas= array();
$personas[]= $arreglo2;
$personas[]= $arreglo;
$arreglo2["locura"] = $personas;
$personas[0]= $arreglo2;
print_r($personas);
echo "<br/>";
foreach($arreglo2 as $key => $value){
echo "$key ->";
if(is_array($value)){
foreach($value as $key2=> $value2){
echo "<br/>..........$key2 -> $value2";
}
}else{
echo $value;
}
print_r($value);
echo "<br/>";
}
?>