【发布时间】:2023-04-11 12:34:01
【问题描述】:
我有这段代码是为了替换 div 里面的内容,">" 和 "
$pageParticulier->post_content=preg_replace("#>"+$old_instance['title']+"<#", ">"+$new_instance['title']+"<",$pageParticulier->post_content);
我有这个警告preg_replace(): Delimiter must not be alphanumeric or backslash
但我不明白的是,我已经为模式设置了分隔符。
【问题讨论】:
-
将
+替换为连接操作符-点-"#>".$old_instance['title']."<#"
标签: php wordpress preg-replace