有一段字符串,存在多个"#https://www.gxlcms.com/xxxxx#"这样的子串,我想把这样的子串转换成其他的字符串,应该怎么做?
#https://www.gxlcms.com/xxxxx#转成
------解决方案--------------------
不用正则的话
$html='#https://www.gxlcms.com/xxxxx##https://www.gxlcms.com/xxxxx#';
$str="#https://www.gxlcms.com/xxxxx#";
$str=str_replace('#https://www.gxlcms.com/xxxxx#','
echo $str;
------解决方案--------------------
------解决方案--------------------
------解决方案--------------------
echo preg_replace('/#([^#]+?)#/is', '
------解决方案--------------------
replace(被替换的字符串,代替的字符串),正则就要看你被替换和替换的都是什么了,推荐用replace
------解决方案--------------------
修饰符/u 什么意思