Skip to content

Commit 41ad40c

Browse files
author
Greg Bowler
committed
tidy: split example JSON
1 parent 3dbe3d3 commit 41ad40c

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

example/02-json-decode.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,17 @@
33

44
require __DIR__ . "/../vendor/autoload.php";
55

6-
$jsonString = '{"name":"Cody","colour":"orange","food":["biscuits","mushrooms","corn on the cob"]}';
6+
$jsonString = <<<JSON
7+
{
8+
"name": "Cody",
9+
"colour": "orange",
10+
"food": [
11+
"biscuits",
12+
"mushrooms",
13+
"corn on the cob"
14+
]
15+
}
16+
JSON;
717

818
$builder = new DataObjectBuilder();
919
$obj = $builder->fromObject(json_decode($jsonString));

0 commit comments

Comments
 (0)