慕沐林林
//Find duplicates $arr = array(
'unique',
'duplicate',
'distinct',
'justone',
'three3',
'duplicate',
'three3',
'three3',
'onlyone' );$unique = array_unique($arr); $dupes = array_diff_key( $arr, $unique );
// array( 5=>'duplicate', 6=>'three3' 7=>'three3' )// count duplicatesarray_count_values($dupes); // array( 'duplicate'=>1, 'three3'=>2 )