求正则表达式完成这个需求
时间:2021-07-01 10:21:17
帮助过:8人阅读

找到文章中这样的图片,替换成

如何写正则表达式,然后如何处理呢
回复讨论(解决方案)
$html = <<
html;$regImg = preg_match_all('/
\")
/', $html, $matches) ;$newSrc = $matches[1][0].'!static"'." _src=\"".$matches[1][0]."!static\" tsrc=\"".$matches[1][0];$html = str_replace($matches[1][0], $newSrc, $html);var_dump($html);
http://www.tantengvip.com/2014/02/preg-match-html/
Click here