While loop problem in PHP

后端 未结 5 904
遥遥无期
遥遥无期 2021-01-27 03:48

I have my markup structure as below:

value1
value2
value3
5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-27 04:31

    By getting some idea from logic given here I tried following and it works.

    '.$rs['value'].'
    '; if ($icount % 4 == 0 && $icount != $itotal){ echo '
    '; echo '
    '; //closed main div echo '
    '; //started new main div } $icount++; } ?>

    That, solved my problem.

    Edited: added itotal condition, so when you will have only 4 records per page then also this will work properly.

提交回复
热议问题