-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharrays2.php
More file actions
43 lines (37 loc) · 771 Bytes
/
arrays2.php
File metadata and controls
43 lines (37 loc) · 771 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
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<?
$myBeatles = array(
"bass" => "Paul McCartney",
"electricguitar" => "George Harrison",
"currentDrummer" => "Ringo Starr",
"acousticguitar" => "John Lennon",
"formerDrummer" => "Pete Best",
"manager" => "George Martin"
);
/*
print( "Current beatle: " );
print( $myBeatles[ "currentDrummer" ] );
print( "Former beatle: " );
print( $myBeatles[ "formerDrummer" ] );
*/
foreach( $myBeatles as $key => $c )
{
if( $key == "manager" )
{
print( "Manager: " );
}
else
{
print( "Current Beatle: " );
}
print( $c );
print( "<br>" );
}
?>
</body>
</html>