array_sum(array_column($arr, 'num'));
// calculate the two-dimensional array of the specified element $ ARR = [ [ 'ID' =>. 1, 'NUM' =>. 3, ] , [ 'ID' => 2, 'NUM' =>. 4, ] , [ ' ID '=>. 3, ' NUM '=>. 1, ] , ]; // calculate the two-dimensional array of the specified element $ ARR = array_sum (array_column ( $ ARR ,' NUM ')); // output. 8 var_dump ( $ arr );