1.统计数组元素个数 $arr = array( '1011,1003,1008,1001,1000,1004,1012', '1009', '1011,1003,1111' ); $result = array(); foreach ($arr as $str) { $str_arr = explode(',', $str); foreach ($str_arr as $v) { // $result[$v] = isset($result[$v]) ? $result[$v] : 0; //