2013-01-07 90 views

回答

6

只需添加一个空间,你的组:

$string = preg_replace('/[^\da-z ]/i', '', $string); 
//       ^Notice the space here 
+2

为了完整性,您可以添加空格在正则表达式中没有任何特殊之处,除非使用'/ x'。 – fge

相关问题