统计二维数组中某个值出现的次数
$data =[ '0' =>[ 'id' => 7, 'patient_id' => 1, 'arr1' => 高, ], '1' =>[ 'id' => 11, 'patient_id' => 1, 'arr1' => 低, ], '2' => [ 'id' => 13, 'patient_id' => 1, 'arr1' => 低, ] ]; 解决: $one['period']=isset(array_count_values(array_column($arr,'policy_status'))[0])?array_count_values(array_column($arr,'policy_status'))[0]:0;