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

前端 未结 22 2871
死守一世寂寞
死守一世寂寞 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:27

    You can use :

    $url=getimagesize(“http://www.flickr.com/photos/27505599@N07/2564389539/”);
    
    if(!is_array($url))
    {
       $default_image =”…/directoryFolder/junal.jpg”;
    }
    

提交回复
热议问题