在PHP项目中,我有:
$string = "1,555"; str_replace(',', '', $string); echo $string; //is still 1,555
str_replace不会删除逗号.如果我var_dump.我明白了string(5) "1,555"
string(5) "1,555"
有任何想法吗?我只是需要删除逗号,以便我可以计算.
php string comma str-replace
comma ×1
php ×1
str-replace ×1
string ×1