-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexample.php
58 lines (54 loc) · 860 Bytes
/
example.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
54
55
56
57
58
<?php
require_once 'vendor/autoload.php';
use JsObj2Php\Converter;
$str = '{
baseprice:3300,
items:[{id:1,price:1000,commnet:"foo",memo:[]},{id:2,price:2000,memo:[]}],
counts:[10, 20],
message:"ほげ",
pickup:{id:1,price:1000,commnet:"foo",memo:[0, 1, 2]}
}';
var_export(Converter::execute($str, true));
/*
array (
'baseprice' => 3300,
'items' =>
array (
0 =>
array (
'id' => 1,
'price' => 1000,
'commnet' => 'foo',
'memo' =>
array (
),
),
1 =>
array (
'id' => 2,
'price' => 2000,
'memo' =>
array (
),
),
),
'counts' =>
array (
0 => 10,
1 => 20,
),
'message' => 'ほげ',
'pickup' =>
array (
'id' => 1,
'price' => 1000,
'commnet' => 'foo',
'memo' =>
array (
0 => 0,
1 => 1,
2 => 2,
),
),
)
*/