Home > php教程 > php手册 > 区分大小写的文件存在判断

区分大小写的文件存在判断

WBOY
Release: 2016-06-07 11:45:53
Original
1350 people have browsed it

PHP默认的file_exists和is_file在Windows下面是不区分大小写的,如果需要严格区分大小写的话,可以尝试使用下面的方法,该方法ThinkPHP已经内置。function file_exists_case($filename) {<br>     if (is_file($filename)) {<br>         if (strstr(PHP_OS, 'WIN')) {<br>             if (basename(realpath($filename)) != basename($filename))<br>                 return false;<br>         }<br>         return true;<br>     }<br>     return false;<br> }

AD:真正免费,域名+虚机+企业邮箱=0元

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template