-
Notifications
You must be signed in to change notification settings - Fork 0
/
update1.php
48 lines (44 loc) · 1.26 KB
/
update1.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
<?php
$file = "rizq.json";
$rizq = file_get_contents($file);
$data = json_decode($zain, true);
$newValues = [
1 => [
'prodi' => 'Teknik Multimedia Awuu',
'jurusan' => 'Teknik Komputer aja ya'
],
2 => [
'prodi' => 'Teknik Mesinin',
'jurusan' => 'Teknik Mesin'
],
3 => [
'prodi' => 'Sistem Abadi',
'jurusan' => 'Teknik Menyeramkan dan Sistem Informasi'
],
4 => [
'prodi' => 'Teknik Industrikita',
'jurusan' => 'Teknik Kita'
],
5 => [
'prodi' => 'Teknik Sipit',
'jurusan' => 'Teknik Sipitika'
],
6 => [
'prodi' => 'Desain Komunikasi aja',
'jurusan' => 'Desain kok Media'
],
7 => [
'prodi' => 'Manajemen Ayo',
'jurusan' => 'Manajemen Ayo ga si'
]
];
foreach ($data as $key => $d) {
$no = $d['no'];
if ($no >= 1 && $no <= 7) {
$data[$key]['prodi'] = $newValues[$no]['prodi'];
$data[$key]['jurusan'] = $newValues[$no]['jurusan'];
}
}
$jsonfile = json_encode($data, JSON_PRETTY_PRINT);
$rizq = file_put_contents($file, $jsonfile);
?>