why don't you just use preg_match to count the duplicates?

i know that this is slower but as the above one doesn't work, you could try this.
sloddl Reviewed by sloddl on . PHP Scan dir for idetical files I am not good with php and will ask for help... * The folder is named 'fav' * There are subfolders in 'fav' * Each subfolder may contain a .txt file Needed --> * Check for identical .txt file names in all subfolders * Sort 10 most repeating identicals,show(echo) their contents and show(echo) times repeated (in brackets such as this one :D ) Rating: 5