php数组中,要得到任意划分为$n份的所有情况,求代码 20
已知$words=array('1','2','3','4','5','6','7','8');$day=3;要得到任意分成$day组的情况例如这样的结果Array([0...
已知
$words = array('1','2','3','4','5','6','7','8');
$day = 3;
要得到任意分成$day组的情况
例如
这样的结果
Array
(
[0] => Array
(
[0] => Array
(
[0] => 1
)
[1] => Array
(
[0] => 23
)
[2] => Array
(
[0] => 4567
)
)
[1] => Array
(
[0] => Array
(
[0] => 1
)
[1] => Array
(
[0] => 56
)
[2] => Array
(
[0] => 2347
)
)
[2] => Array
(
[0] => Array
(
[0] => 12
)
[1] => Array
(
[0] => 56
)
[2] => Array
(
[0] => 347
)
) 展开
$words = array('1','2','3','4','5','6','7','8');
$day = 3;
要得到任意分成$day组的情况
例如
这样的结果
Array
(
[0] => Array
(
[0] => Array
(
[0] => 1
)
[1] => Array
(
[0] => 23
)
[2] => Array
(
[0] => 4567
)
)
[1] => Array
(
[0] => Array
(
[0] => 1
)
[1] => Array
(
[0] => 56
)
[2] => Array
(
[0] => 2347
)
)
[2] => Array
(
[0] => Array
(
[0] => 12
)
[1] => Array
(
[0] => 56
)
[2] => Array
(
[0] => 347
)
) 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询