-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharraypractice.php
More file actions
41 lines (35 loc) · 797 Bytes
/
arraypractice.php
File metadata and controls
41 lines (35 loc) · 797 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
<?php
// $number = [
// 1,
// 2,
// 3,
// 4,
// 5,
// ];
// // var_dump($number);
// // print_r($number);
// echo $number[3] . PHP_EOL;
$arrayOfPeople = [
[
'first_name' => 'Micah',
'last_name' => 'Johnson',
'email' => 'MicahJohnson1983@gmail.com',
'phone' => '3282979',
],
[
'first_name' => 'Rachel',
'last_name' => 'Moczygemba',
'email' => 'Rmoczygemba@gmail.com',
'phone' => '6834166',
],
[
'first_name' => 'Emily',
'last_name' => 'Johnson',
'email' => 'emilyjohnson712@gmail.com',
'phone' => '4147205',
],
];
// print the entire array
print_r($arrayOfPeople);
// print one data type from within the array
echo $arrayOfPeople[2]['phone'] . PHP_EOL;