2010-12-17 370 views

回答

106

你可以使用

preg_replace('/[.,]/', '', $string); 

但使用简单的字符替换正则表达式是矫枉过正。

你会更好使用strtr

strtr($string, array('.' => '', ',' => '')); 

str_replace

str_replace(array('.', ','), '' , $string); 
相关问题