My json looks like this
[
{
"name":"test.xlsx",
"type":"application\/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"tmp_name":"D:\\xampp\\tmp\\phpEFF8.tmp",
"error":0,
"size":3278935
},
{
"name":"test2.pptx",
"type":"application\/vnd.openxmlformats-officedocument.presentationml.presentation",
"tmp_name":"D:\\xampp\\tmp\\phpF018.tmp",
"error":0,
"size":41167
}
],
[
{
"name":"images.jpg",
"type":"image\/jpeg",
"tmp_name":"D:\\xampp\\tmp\\php8C1.tmp",
"error":0,
"size":9077
}
]
I want to set as one array like this [0] [1] [2]
Expected array
array (
[0] => array (
['name'] => 'test.xlsx',
['type'] => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
['tmp_name'] => 'D:\\xampp\\tmp\\php1926.tmp',
['error'] => 0,
['size'] => 3278935
)
[1] => array (
['name'] => 'test2.pptx',
['type'] => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
['tmp_name'] => 'D:\\xampp\\tmp\\php1956.tmp',
['error'] => 0,
['size'] => 41167
)
[2] => array (
['name'] => 'images.jpg',
['type'] => 'image/jpeg',
['tmp_name'] => 'D:\\xampp\\tmp\\php5A68.tmp',
['error'] => 0,
['size'] => 9077
)
)
)
PHP I tried like this
$examples ='{[
{
"name":"test.xlsx",
"type":"application\/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"tmp_name":"D:\\xampp\\tmp\\phpEFF8.tmp",
"error":0,
"size":3278935
},
{
"name":"test2.pptx",
"type":"application\/vnd.openxmlformats-officedocument.presentationml.presentation",
"tmp_name":"D:\\xampp\\tmp\\phpF018.tmp",
"error":0,
"size":41167
}
],
[
{
"name":"images.jpg",
"type":"image\/jpeg",
"tmp_name":"D:\\xampp\\tmp\\php8C1.tmp",
"error":0,
"size":9077
}
]}';
$examples = json_decode($examples);
print_r($examples);