What is the PHP array definition of this JSON:
[
['id' => 1, 'name' => 'TV & Home Theather'],
['id' => 2, 'name' => 'Tablets & E-Readers'],
['id' => 3, 'name' => 'Computers', 'children' => [
['id' => 4, 'name' => 'Laptops', 'children' => [
['id' => 5, 'name' => 'PC Laptops'],
['id' => 6, 'name' => 'Macbooks (Air/Pro)']
]],
['id' => 7, 'name' => 'Desktops'],
['id' => 8, 'name' => 'Monitors']
]],
['id' => 9, 'name' => 'Cell Phones']
];
Something like this outputs curly braces, which is not what I want:
$foo = array(array('id' => 1, 'name' => 'TV & Home Theater'));
var_dump(json_encode($foo));
The output is:
[{
"id": 1,
"name": "TV & Home Theater"
}]
I need this to only be brackets, no curly braces. Ideas?
object.property_name
note: if you lose the curly braces, you'll lose the "key -> value" association and you can only store the values.