Correct PHP way to check if external image exists?

后端 未结 9 1301
清歌不尽
清歌不尽 2021-02-04 08:49

I know that there are at least 10 the same questions with answers but none of them seems to work for me flawlessly. I\'m trying to check if internal or external image exists (is

9条回答
  •  礼貌的吻别
    2021-02-04 09:51

    I found try catch the best solution for this. It is working fine with me.

    try{
          list($width, $height) = getimagesize($h_image->image_url);
       }
    catch (Exception $e)
        {
        }
    

提交回复
热议问题