PHP Case Insensitive Version of file_exists()

后端 未结 14 1481
忘掉有多难
忘掉有多难 2020-11-30 07:47

I\'m trying to think of the fastest way to implement a case insensitive file_exists function in PHP. Is my best bet to enumerate the file in the directory and do a strtolowe

14条回答
  •  爱一瞬间的悲伤
    2020-11-30 08:18

    For a pure PHP implementation, yes. There's an example in the comments for the file_exists function.

    The other option would be to run your script on a case insensitive file system.

提交回复
热议问题