我只是想替换以下字符串:替换字符串PHP词多次出现
This is my first sentence.
.:.
This is my second sentence.
.:.
This is my third sentence.
.:.
输出应该是这样的:
This is my first sentence.
1
This is my second sentence.
2
This is my third sentence.
3
我怎么能做到这一点的更有效,更容易办法?
看看这里[preg_replace_callback](http://php.net/manual/en/function.preg-replace-callback.php)。你能明白吗? –
不,我不明白 – fawad