/ Published in: PHP

Ordenamento de array para exibição em colunas múltiplas, via UL float.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// Tratamento da ordem para multiplas colunas $nColunas = 4; for( $i=1; $i<=$nColunas; $i++ ){ } $col=1; foreach( $arr as $item ) { $coluna[$col][] = $item; if( ++$col > $nColunas ) $col = 1; } for( $i=1; $i<=$nColunas; $i++ ) { foreach( $coluna[$i] as $item ) { $arrOut[] = $item; } } $this->view->itens = $arrOut;
Comments
