远程图片存在性如何快速判断?
- 内容介绍
- 文章标签
- 相关推荐
本文共计127个文字,预计阅读时间需要1分钟。
phpfunction remoteImageExist($url) { // 定义图像类型映射 $imageTypes=[ 1=> 'GIF', 2=> 'JPG', 3=> 'PNG', 4=> 'SWF', 5=> 'PSD', 6=> 'BMP', 7=> 'TIFF(intel byte order)', 8=> 'TIFF(motorola byte order)', 9=> 'JPC' ];}
function remoteImageExist($url) { // $exif_imagetype = [ // 1 => 'GIF', // 2 => 'JPG', // 3 => 'PNG', // 4 => 'SWF', // 5 => 'PSD', // 6 => 'BMP', // 7 => 'TIFF(intel byte order)', // 8 => 'TIFF(motorola byte order)', // 9 => 'JPC', // 10 => 'JP2', // 11 => 'JPX', // 12 => 'JB2', // 13 => 'SWC', // 14 => 'IFF', // 15 => 'WBMP', // 16 => 'XBM' // ]; $isExsit = @exif_imagetype($url); if ($isExsit === false) return false; return in_array($isExsit, [1, 2, 3]) ? true : false; } $url = '192.168.10.142:4869/3eb4f5b310207399d1d9bf805a127ac6?p=0'; remoteImageExist($url);
本文共计127个文字,预计阅读时间需要1分钟。
phpfunction remoteImageExist($url) { // 定义图像类型映射 $imageTypes=[ 1=> 'GIF', 2=> 'JPG', 3=> 'PNG', 4=> 'SWF', 5=> 'PSD', 6=> 'BMP', 7=> 'TIFF(intel byte order)', 8=> 'TIFF(motorola byte order)', 9=> 'JPC' ];}
function remoteImageExist($url) { // $exif_imagetype = [ // 1 => 'GIF', // 2 => 'JPG', // 3 => 'PNG', // 4 => 'SWF', // 5 => 'PSD', // 6 => 'BMP', // 7 => 'TIFF(intel byte order)', // 8 => 'TIFF(motorola byte order)', // 9 => 'JPC', // 10 => 'JP2', // 11 => 'JPX', // 12 => 'JB2', // 13 => 'SWC', // 14 => 'IFF', // 15 => 'WBMP', // 16 => 'XBM' // ]; $isExsit = @exif_imagetype($url); if ($isExsit === false) return false; return in_array($isExsit, [1, 2, 3]) ? true : false; } $url = '192.168.10.142:4869/3eb4f5b310207399d1d9bf805a127ac6?p=0'; remoteImageExist($url);

