【发布时间】:2016-02-29 14:57:26
【问题描述】:
我拥有的是
$string = 'one;two;three;four;five;six;seven;eight;nine;ten';
我需要的是:
$array = [
['one', 'two', 'three'],
['four', 'five', 'six'],
['seven', 'eight', 'nine'],
['ten'],
];
基本上字符串可以有无限的值。
【问题讨论】:
-
总是三人一组?
-
你不知道 PHP 有一个documentation 吗?现在你可以了。
-
Argg...我不知道我是怎么错过的。
标签: php arrays regex split php-5.5