This article mainly introduces PHP based on the operating system to convert file name case method, the need for friends can refer to the
In the development of PHP we want to include a file The usual code is this: the code is as follows: <?php if (Is_file ($fileName)) require $flleName; Running under Windows,linux does not ask a question: Suppose you want to include a d:/web/webserver/a.php file at the time of the value of the message d:/web/webserver/a.php when running under Windows will also d:/web/ Webserver/a.php is included because Windows is not case-sensitive, and it will be wrong if you put it on Linux. Is it possible to be case-sensitive when loading Windows? The code is as follows: if (Is_file ($fileName)) {//php_os currently running operating system if (STRSTR (Php_os, ' WIN ')) {//realpath ($fileName) converts The case of the filename/web/a.php if a.php does not exist and a.php returns/web/a.php if (basename ($fileName) = = Realpath ($fileName)) Require $fileName; else echo ' Please check the case of file '; }else require $fileName; }