-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1.php
More file actions
47 lines (34 loc) · 1 KB
/
1.php
File metadata and controls
47 lines (34 loc) · 1 KB
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
class School {
public $highSchool = "SMAN 1 Jakenan";
public $university = "Universitas Muria Kudus";
}
class Skill {
public $name;
public $score;
function __construct($name = null, $score = null) {
$this->name = $name;
$this->score = $score;
}
}
function get_bio() {
$name = "Dimyati Utoyo";
$address = "Ds. Pelemgede 9/2 Jl. Raya Pucakwangi - Jakenan, Pati, Jawa Tengah";
$hobbies = array("Badminton", "Nonton Film", "Main Game");
$is_married = false;
$school = new School();
$arr_skill_obj = [];
$arr_skill_obj[] = new Skill("Badminton", 80);
$arr_skill_obj[] = new Skill("Membaca pikiran orang lain", 20);
$data = array(
'name' => $name,
'address' => $address,
'hobbies' => $hobbies,
'is_married' => $is_married,
'school' => $school,
'skilss' => $arr_skill_obj
);
return json_encode($data);
}
echo '<pre>';
echo get_bio();;