//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 duplicates array_count_values($dupes); // array( 'duplicate'=>1, 'three3'=>2 )
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter