Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
我通常使用类似的东西:
$string = preg_replace("/[^ \w]+/", "", $string);
将所有非空格和非单词字符替换为空。
I normally use something like:
That replaces all non-space and non-word characters with nothing.
[^0-9a-zA-Z_\s]
是你想要替换的。
is what you want to replace.
<?php $string = 'April 15, 2003'; $pattern = '/[^\w ]+/'; $replacement = ''; echo preg_replace($pattern, $replacement, $string); ?>
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(3)
我通常使用类似的东西:
将所有非空格和非单词字符替换为空。
I normally use something like:
That replaces all non-space and non-word characters with nothing.
是你想要替换的。
is what you want to replace.