phpThumb() 中无法建立连接错误
No connection could be made error in phpThumb()
我正在使用 phpThunmb 显示来自外部的图像 link。对于某些图像,出现了如下类型的错误。
我试图获取该图像的 header 信息,如下所示..
$headers = get_headers($external_image_url);
但结果是空的。如何解决这个错误?如果无法访问此图像,那么如何在其位置显示替代 "image imageNotFound.jpg" .
尝试使用此代码检查给定图像是否存在。
if(file_exists($external_image_url))
{
$image_link = $external_image_url; //if that image exists
}
else
{
$image_link = "imageNotFount.jpg"; //if that image does not exists
}
我正在使用 phpThunmb 显示来自外部的图像 link。对于某些图像,出现了如下类型的错误。
我试图获取该图像的 header 信息,如下所示..
$headers = get_headers($external_image_url);
但结果是空的。如何解决这个错误?如果无法访问此图像,那么如何在其位置显示替代 "image imageNotFound.jpg" .
尝试使用此代码检查给定图像是否存在。
if(file_exists($external_image_url))
{
$image_link = $external_image_url; //if that image exists
}
else
{
$image_link = "imageNotFount.jpg"; //if that image does not exists
}