- array_map: documentation ( source)
- count: documentation ( source)
- array_merge: documentation ( source)
- var_export: documentation ( source)
- key: documentation ( source)
<?php
$array = [
[
["2011-11-18 00:00:00" => 'C'],
["2011-11-18 00:00:00" => 'I'],
["2011-11-18 00:00:00" => 'S'],
],
[
["2011-11-22 00:00:00" => 'C'],
["2011-11-22 00:00:00" => 'S']
]
];
var_export(
array_merge(
...array_map(
fn($set) => [key($set[0]) => count($set, COUNT_RECURSIVE) - count($set)],
$array
)
)
);