标签:
<?php $uids = array(1,2,3,4,5,6,7); $uids_num = count($uids); $k = $j = 0; $uids_group = array(); for ($i = 0; $i < $uids_num; $i++) { if (($i+1) % 2 == 0) { $uids_group[$k][$j] = $uids[$i]; $k += 1; $j = 0; } else { $uids_group[$k][$j] = $uids[$i]; $j++; } } print_r($uids_group);exit;
标签:
原文地址:http://www.cnblogs.com/joshua317/p/5505849.html