$myarray = array("1","2","3","4","5");
$count = count($myarray);
if($count%2 == 0) {
$firstfor = intval(($count/2));
$secondfor = intval(($count/2));
}else{
$firstfor = intval(($count/2))+1;
$secondfor = intval(($count/2));
}
$leftDate = array();
$rigthDate = array();
for($i=0;$i<$count;) {
$leftDate[] = $myarray[$i];
$i += 2;
}
for($i=1;$i<$count;) {
$rigthDate[] = $myarray[$i];
$i += 2;
}
for($i=0;$i echo $leftDate[$i];
}
for($i=0;$i echo $rigthDate[$i];
}
不能只考虑输出的ID是否为奇偶数。而应当要考虑的是 有间隔性的输出操作!
阅读(771) | 评论(0) | 转发(0) |