How to make is_dir($FoLdEr) case insensitive in php? -


I do not need is_dir () what folder or logic is up

So if the folder is named "My Folder" and I run is_dir ("my FoLdEr") then the result is correct .

It does not even have PHP, it depends on operating system and file system that is running PHP. Windows case is insensitive, but every version of Unix / Linux is case-sensitive.

I must install it in another way: is_dir () is basically a wrapper for system calls or use the results of the system call on this file information. Whether the system call will return something or not, according to the rules of the operating system and file system, one file matches the name, the PHP can not change it, so that's why you are not just on is_dir () Can create case assassets.

Check the list of files you can best to see the directory and the loop whether the insensitive comparison of any case compared to what you are looking for.

Note: You will match many hits like "Home" and "Home" both "matches"

Alternatively you can use all your filenames in lowercase And then you can use the lowercase version of your input to find the specified file.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -