Using preg_replace instead of str_replace to substitute all non-digit characters
This commit is contained in:
parent
cce037f169
commit
3b7e818f22
1 changed files with 1 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
function rf($num) {
|
||||
return str_replace(',','.',$num);
|
||||
return preg_replace('#\D#u','.',$num);
|
||||
}
|
||||
?>
|
||||
|
|
Loading…
Reference in a new issue