$cars = array("apple","banner","orgin","grape"); print_r(array_chunk($cars,2)); ?>
$cars = array("apple","banner","orgin","grape");
print_r(array_chunk($cars,2));
?>
输出的结果
Array ( [0] => Array ( [0] => apple [1] => banner ) [1] => Array ( [0] => orgin [1] => grape ) )
关联数组分裂成新的数组块
使用道具 举报
本版积分规则 发表回复 回帖后跳转到最后一页
|Archiver|手机版|小黑屋|宜信同城网交流论坛 ( 闽ICP备19021048号 )|站点地图
GMT+8, 2026-3-28 00:46 , Processed in 0.214168 second(s), 13 queries , Redis On.
Powered by Discuz! X3.4
Copyright © 2001-2020, Tencent Cloud.