21,886
社区成员
发帖
与我相关
我的任务
分享
$url="http://tuku.military.china.com/military//pic/2008-12-25/419af5f9-8c7b-405d-a4de-c2b3495d714e.jpg";
$array1 = get_headers($url1);
if ($array1[2] == 'Content-Type: image/jpeg') {
echo "图片存在";
}
<?php
$url = 'http://tuku.military.china.com/military//pic/2008-12-25/419af5f9-8c7b-405d-a4de-c2b3495d714e.jpg';
if( @fopen( $url, 'r' ) )
{
echo 'exists';
}
else
{
echo 'not exists';
}
?>
if( file_exists( $url ) )
{
echo 'exists';
}
else
{
echo 'not exists';
}