-
Notifications
You must be signed in to change notification settings - Fork 0
/
c4.php
53 lines (51 loc) · 1.48 KB
/
c4.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
<?php
$personProfile = [
'name' => 'John Doe',
'age' => 30,
'address' => [
'street' => '123 Main St',
'city' => 'Anytown',
'state' => 'CA',
'zipcode' => '12345'
],
'addresses'=>[
'home'=>[
'street' => '123 Main St X',
'city' => 'Anytown',
'state' => 'CA',
'zipcode' => '12345'
],
'work'=>[
'street' => '456 Business St',
'city' => 'Metro City',
'state' => 'CA',
'zipcode' => '54321'
]
],
'contact' => [
'email' => '[email protected]',
'phone' => '555-1234'
],
'employment' => [
'job_title' => 'Software Engineer',
'company' => 'Tech Solutions',
'years_experience' => 8
],
'education' => [
'degree' => 'Bachelor of Science in Computer Science',
'university' => 'State University',
'graduation_year' => 2015
],
'skills' => [
'programming_languages' => ['PHP', 'JavaScript', 'Python'],
'frameworks' => ['Laravel', 'React', 'Django'],
'tools' => ['Git', 'Docker', 'Jenkins']
],
'hobbies' => ['reading', 'hiking', 'gaming']
];
// $json = json_encode($personProfile, JSON_PRETTY_PRINT);
// $json = json_encode($personProfile);
// file_put_contents("profile.json", $json);
$personData = file_get_contents("profile.json");
$person = json_decode($personData, true);
echo $person['addresses']['home']['street'];