preg_replace匹配尖括号的问题
程序员文章站
2022-05-20 14:50:33
...
$wenzis="我是";$wenzi="黑色"; $tihuanzhi = ""; //要替换的值 $wenzis = preg_replace($tihuanzi, $wenzi, $wenzis,1);
替换结果是 "我是",替换结果没把尖括号去掉,请教怎么把尖括号也替换掉
回复讨论(解决方案)
$wenzis = "我是";$wenzi = "黑色";$tihuanzhi = "//"; //要替换的值$wenzis = preg_replace($tihuanzhi, $wenzi, $wenzis,1);echo $wenzis;我是黑色
搞定了,谢谢