file_exists() is too slow in PHP. Can anyone suggest a faster alternative?

后端 未结 19 1067
迷失自我
迷失自我 2021-02-05 01:18

When displaying images on our website, we check if the file exists with a call to file_exists(). We fall back to a dummy image if the file was missing.

Howe

19条回答
  •  走了就别回头了
    2021-02-05 01:49

    When you save a file to a folder, if the upload was successfully, you can store the path to a DB Table.

    Then you will just have to make a query to the database in order to find the path of the requested file.

提交回复
热议问题