开发者

eregi replace replacement

开发者 https://www.devze.com 2023-01-02 15:54 出处:网络
since eregi replace was deprecated on version 5.3 i want to make my program compatible with new version of php

since eregi replace was deprecated on version 5.3 i want to make my program compatible with new version of php http://php.net/manual/en/function.eregi-replace.php

so, i'm trying to use preg_replace like this

preg_replace(",",'','20,000.00');

but c开发者_如何学编程ome with error

i'm familiar with eregi_replace(',','','20,000.00'); i'm not familiar with regex expression. what is the best replacement for eregi_replace?


preg_replace needs delimiters

$value = '20,000.00';    
$value = preg_replace("/,/",'',$value);    
echo $value;


str_replace(",",'','20,000.00');
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号