-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharrays3.php
More file actions
46 lines (39 loc) · 934 Bytes
/
arrays3.php
File metadata and controls
46 lines (39 loc) · 934 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>
<head>
<title></title>
</head>
<body>
<?
$myBeatles = array(
"bass" => array(
"name" => "Paul McCartney",
"age" => 71,
"OtherBands" => "Wings,The Fireman"
),
"drums" => array(
"name" => "Ringo Starr",
"age" => 64
),
"guitars" => array(
"name" => "George Harrison",
"age" => 65,
"OtherBands" => "The Traveling Wilburys"
)
);
foreach( $myBeatles as $currentBeatle )
{
print( $currentBeatle[ "name" ] );
print( "<br>" );
print( $currentBeatle[ "age" ] );
print( "<br>" );
if( $currentBeatle[ "OtherBands" ] != "" )
{
print( "He also played with: " );
print( $currentBeatle[ "OtherBands" ] );
print( "<br>" );
}
}
?>
</body>
</html>