我有一堆文字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