我只是想替換以下字符串:替換字符串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