| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
  [2015-11-12 23:30 UTC] eparlakay at hotmail dot com
 Description:
------------
Scandir function wrongly interprets the Turkish "ı" (i without dot) character. It interprets the "ı" as "i".
For the test script, assume there are two directories in a folder:
c:\Music\
 |
 | Aslı
 | Asli
Test script:
---------------
<?php
	$FILES = scandir("C:\\Music\\");
	
	foreach($FILES as $k=>$v)
	{
		if(!mkdir("c:\\TEST\\".$v))
		{
			echo "ERROR for ".$v."\n";
		}
                else
		{
			echo "Folder is created\n";
		}
	}
?>
Expected result:
----------------
Folder is created
Folder is created
Actual result:
--------------
Folder is created
Warning: mkdir(): File exists in C:\testingScandir.php on line 6
ERROR for Sila: 
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             | 
    |||||||||||||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 07:00:01 2025 UTC | 
Apparently, the issue is already with scandir(). var_dump'ing its result (PHP 7.0.7, German Windows 10): array(4) { [0]=> string(1) "." [1]=> string(2) ".." [2]=> string(4) "Asli" [3]=> string(4) "Asli" } While dir(1) reports: 14.06.2016 00:33 <DIR> . 14.06.2016 00:33 <DIR> .. 14.06.2016 00:31 <DIR> Asli 14.06.2016 00:31 <DIR> Aslı