Php array problem

$arr = [
            ["name"=>"abc",value=>12],
            ["name"=>"abc",value=>15],
            ["name"=>"abc123",value=>555],
        ];

$arr   
$arr = [
            ["name"=>"abc",value=>27],
            ["name"=>"abc123",value=>555],
        ];
        
? ?
Apr.11,2021

<?php
$arr = [
    ['name'=>'abc',"value"=>12],
    ['name'=>'abc',"value"=>15],
    ['name'=>'abc123',"value"=>555],
];
$re = array_reduce($arr,function($p,$c){
    foreach($p as &$item){
        if($item["name"] == $c["name"]){
            echo $c["value"];
            echo $item["value"];
            $item["value"]=$item["value"]+$c["value"];
            return $p;
        }
    }
    array_push($p,$c);
    return $p;
},[]);

function test($arr, $k, $v){
    $aa = [];
    foreach($arr as $item) {
        $aa[$item[$k]] = isset($aa[$item[$k]]) ? $aa[$item[$k]] + $item[$v]  : $item[$v];
    }
    return $aa;
}

$result = test($arr, 'name', 'value');
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e46478-438cb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e46478-438cb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?