Page

[php]获取正文第一张图片地址

675Anson17-12-30



$reg = '/<img[^>]*src=[\'"]?([^>\'"\s]*)[\'"]?[^>]*>/i';
$content = "";
preg_match($reg, $content,$photo);  //获取文章第一张图片做头条大图

$thumb = $photo[1];





来自ansion博客 

http://www.tp0.top

2017-12-30 13:42:17