热搜:NVER node 开发 php

preg_replace的使用问题?

2024-09-04 13:50:01
preg_replace的使用问题?

本帖最后由 u013747505 于 2014-02-23 16:36:03 编辑

preg_replace


如图所示。在原来的基础上增加一个img标签 地址参数调用前面超文本的参数。
另外一段代码有很多个这样的结构标签 我都要替换。 不能用array了吧?

回复讨论(解决方案)

$html = <</i', $html, $match);foreach ($match[0] as $key => $value) {	$newValue = $value."\n";	$html = str_replace($value, $newValue, $html);}var_dump($html);