 |
|
shengtao
V2EX member #58731, joined on 2014-03-22 11:33:41 +08:00
|
 |
Per shengtao's settings, the topics list is hidden |
Deals info, including closed deals, is not hidden
shengtao's recent replies
安全第一!有必要买。
如果自己有车,且如果有新生儿能用的安全座椅,那就买安全座椅;如果打车/租车之类的,买安全提篮。
```php
$arr = [];
foreach ($a as $v) {
$arr = array_merge($arr, $v);
}
// 如果需要过滤 null 值的话
$arr = array_filter($arr, function ($item) {
return !is_null($item);
});
$c = array_count_values($arr);
$result = [];
foreach ($c as $key => $value) {
$result[] = [
'name' => $key,
'counts' => $value,
];
}
var_dump($result);
```