1
$string = "Some words here. More words, followed by 1.5 and 2.3 here.Here is no space after the dot."

文の間のドットの後に空白を追加する必要があります(誰もいない場合)が、フロートのドットは変更しないでください。

$result = "Some words here. More words, followed by 1.5 and 2.3 here. Here is no space after the dot."

「ここ。ここ」だった「ここ。ここ」になった

たくさん試しましたが、解決策が見つかりません。

4

1 に答える 1

3

これで済むはず…

preg_replace('/([a-z]+)\.([^\s])/i', '$1. $2', $string);
于 2012-08-06T23:31:32.590 に答える