我有一堆文字IKE的php 5個字符替換文字後?
比方說
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy.
我想使它所以如果一個單詞長度超過5個字符,它取代了字符+。因此,該字符串將成爲
Lorem Ipsum is simpl+ dummy text of the print+++ and types++++++ indus+++. Lorem Ipsum has been the indus+++++ stand+++ dummy.
但我不希望包括標點符號,如!和,和。但我想包括撇號'
任何想法我可以做到這一點?
好的呼籲,積極lookbehind。這是使用回調函數的更優雅的解決方案。 – 2011-06-17 06:50:09