- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
function vstyle($col_num, $arr) {
$a = array();
$size = sizeof($arr);
$row_num = floor( $size / $col_num);
if(count($arr) <= 0) {
return $a;
}
for( $i = 0; $i < $col_num - 1; $i++) {
$a[$i] = array_slice( $arr, $i * $row_num, $row_num);
}
$a[$col_num - 1] = array_slice( $arr, $row_num * ($col_num - 1), $size - $row_num * ($col_num - 1));
/* foreach($arr as $key=>$value) {
$num = $i % $col_num;
$a[$num][$key] = $value;
$i++;
}
*/
return $a;
}
Lure Of Chaos 25.10.2010 23:17 # 0
Lure Of Chaos 25.10.2010 23:18 # +1
DrFreez 26.10.2010 01:43 # +4
Lure Of Chaos 26.10.2010 10:14 # +1
ну хотя бы теперь не беспардонный ))
Sum 26.10.2010 12:43 # 0
blackray 25.08.2021 02:08 # 0