$reg = '/<img[^>]*src=[\'"]?([^>\'"\s]*)[\'"]?[^>]*>/i'; $content = ""; preg_match($reg, $content,$photo); //获取文章第一张图片做头条大图 $thumb = $photo[1];
来自ansion博客
2017-12-30 13:42:17
675Anson17-12-30
$reg = '/<img[^>]*src=[\'"]?([^>\'"\s]*)[\'"]?[^>]*>/i'; $content = ""; preg_match($reg, $content,$photo); //获取文章第一张图片做头条大图 $thumb = $photo[1];
来自ansion博客
2017-12-30 13:42:17