当前位置:Gxlcms >
PHP教程 >
一段PHP的preg_replace正则替换代码求优化更好的。多谢大家
一段PHP的preg_replace正则替换代码求优化更好的。多谢大家
时间:2021-07-01 10:21:17
帮助过:6人阅读
一段PHP的preg_replace正则替换代码求优化更好的。谢谢大家
$text1 =
'
123345
https://img.gxlcms.com/ 
https://img.gxlcms.com/ 
https://img.gxlcms.com/ 
https://img.gxlcms.com/ 
';
$test2 = '
echo preg_replace($pattern, $test2, $text1);我用了
$pattern = '/
各位高手帮我优化下谢谢。
------解决方案--------------------
$pattern = '/
$pattern = '#
str_replace('src="/','src="http://www.qq.com/',$text1);