如何在现有基础上加上限制当图片高度和宽度同时大于200时才能作为文章缩略图
现有代码如下:
$body=$val['message'];
$img_array = array();
preg_match_all("/src=[\"|'|\s]{0,}(http:\/\/([^>]*))(\"|'|\s)/isU",$body,$img_array);
$img_array = array_unique($img_array[1]);
if(count($img_array)>0){
foreach($img_array AS $key => $attach) {
if($key==1){?>
<div class="aw-article-text col-md-4">
<img class="img-polaroid kltu" src="<?php echo $attach; ?>" alt="<?php echo $val['title']; ?>" />
</div>
<?php }}} ?>
获取图片信息:
list($width, $height, $type, $attr) = getimagesize('http://thumb.dresslink.com/V3...');
var_dump($attr);
结果截图:
