How can I check if a file exists on a remote server using PHP?

后端 未结 6 1247
时光取名叫无心
时光取名叫无心 2020-12-02 20:47

How can I check if a specific file exists on a remote server using PHP via FTP connections?

6条回答
  •  南方客
    南方客 (楼主)
    2020-12-02 20:55

    You can use ftp_nlist to list all the files on the remote server. Then you should search into the result array to check if the file what you was looking for exists.

    http://www.php.net/manual/en/function.ftp-nlist.php

提交回复
热议问题