Check if file exists on remote machine

前端 未结 1 433
北海茫月
北海茫月 2020-12-07 04:33

I want to check if a file exists on a remote webserver with php.

I now have this function:

function url_exists($url) {
   // Version 4.x supported
           


        
相关标签:
1条回答
  • 2020-12-07 05:28

    The remote server probably resolves files using the Host header.
    If so, you need to use a domain name.

    You may be able to explicitly pass a Host header to the IP address, but I wouldn't recommend it.

    0 讨论(0)
提交回复
热议问题