*********
Porsche_maniak Reviewed by Porsche_maniak on . Count a function true/false foreach($filenames as $count){ $filedup=basename($count,'.txt'); $filedup=array($filedup); print_r (array_count_values($filedup)); } But this gives Array ( => 1 ) Array ( => 1 ) Array ( => 1 ) Array ( => 1 ) So the array_count_values function does not work because everything is in separate array and that seems to be from foreach. Rating: 5