相关疑难解决方法(0)

爆炸其他每一个字

让我们说我有一个字符串:

$string = "This is my test case for an example."
Run Code Online (Sandbox Code Playgroud)

如果我根据''得到一个爆炸而爆炸

Array('This','is','my','test','case','for','an','example.');
Run Code Online (Sandbox Code Playgroud)

我想要的是每隔一个空间爆炸:

Array('This is','my test','case for','an example.').
Run Code Online (Sandbox Code Playgroud)

字符串可能有一些奇数字,因此数组中的最后一项可能不包含两个单词.

有人知道怎么做吗?

php explode

3
推荐指数
2
解决办法
2868
查看次数

标签 统计

explode ×1

php ×1