preg_match_all( '/<img.*?src="(.*?)".*?>/i', $article_info['content'], $matchs );
$lazySrcs = array();
if( !empty($matchs[1]) ) {
foreach( $matchs[1] as $k=>$v ) {
$lazySrcs[] = '<img class="lazy" width="100%" data-src="'.$v.'" >';
}
}
$newsrcs = str_replace( $matchs[0], $lazySrcs, $article_info['content'] );
$article_info['content'] = $newsrcs;
im标签正则表达式
只有地板了
崇拜你