在我当前的网站上,我正在使用此代码获取第一张图片,女巫在帖子内
$first_img = '';
$my1content = AD($row['post_content']);
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $my1content, $matches);
$first_img = $matches [1] [0];
if(empty($first_img)){ //Defines a default image
$first_img = "/img/default.png";
}
我想知道如何获取帖子中的所有图像,而不仅仅是第一个。感谢您阅读此消息。