php读取出字符串中的img标签中的图片路径
$pageContents = '字符串,带img标签';
$pageContents = str_replace('\"','"',$pageContents);
$reg = '/<img (.*?)+src=[\'"](.*?)[\'"]/i';
preg_match_all( $reg , $pageContents , $results );
//打印出来
var_dump(json_encode($results[2]));
2022-10-27 14:12:34
php读取出字符串中的img标签中的图片路径
$pageContents = '字符串,带img标签';
$pageContents = str_replace('\"','"',$pageContents);
$reg = '/<img (.*?)+src=[\'"](.*?)[\'"]/i';
preg_match_all( $reg , $pageContents , $results );
//打印出来
var_dump(json_encode($results[2]));