Using preg_replace instead of str_replace to substitute all non-digit characters

This commit is contained in:
pezcurrel 2023-12-29 10:00:12 +01:00
parent cce037f169
commit 3b7e818f22

View file

@ -1,5 +1,5 @@
<?php
function rf($num) {
return str_replace(',','.',$num);
return preg_replace('#\D#u','.',$num);
}
?>