How can one check to see if a remote file exists using PHP?

前端 未结 22 2558
死守一世寂寞
死守一世寂寞 2020-11-22 05:52

The best I could find, an if fclose fopen type thing, makes the page load really slowly.

Basically what I\'m trying to do is

22条回答
  •  无人及你
    2020-11-22 06:19

    This is not an answer to your original question, but a better way of doing what you're trying to do:

    Instead of actually trying to get the site's favicon directly (which is a royal pain given it could be /favicon.png, /favicon.ico, /favicon.gif, or even /path/to/favicon.png), use google:

    
    

    Done.

提交回复
热议问题