【发布时间】:2009-05-08 16:53:50
【问题描述】:
假设我有一个字符串:
$string = "This is my test case for an example."
如果我确实基于''爆炸,我会得到一个
Array('This','is','my','test','case','for','an','example.');
我想要的是其他空间的爆炸:
Array('This is','my test','case for','an example.').
字符串可能包含奇数个单词,因此数组中的最后一项可能不包含两个单词。
有人知道怎么做吗?
【问题讨论】: