Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要使用以下规则替换正则表达式:
.
如果之前不存在整数.,则应将其替换。
$input =(包含任何字符、符号、数字、浮点数等)
例子:
$myString = "Example 1.58 Stack.68";
输出应该是
Example 1.58 Stack,68
preg_replace('#(?<!\d)\.#',',',$myString)