【发布时间】:2011-10-05 04:11:52
【问题描述】:
我试图让 preg_replace 从消息中完全删除字符串
这里是 $message 的示例:
hello there john214
welcome to the site!
please get feel free to kick back and relax.
其中john214是通过db输出的用户名
现在我想使用 preg_replace 删除 hello there john214,但是,我的代码正在删除除 john214 之外的所有内容
这是我的代码:
$message = preg_replace('|hello there (.*?)|si', '', $message);
为什么不删除john214?
【问题讨论】:
标签: php preg-replace