Hello I am a complete noob to php and code, I have a simple project but I just can't seem to find a solution. this is the code I have so far... I just need each line to stop at a count of 25 with a break and then continue up to 500. <?php $date1 = date('l F j, Y'); $date2 = date('d/m/Y'); $date3 = date('d/m/Y H:i:s'); echo" Date 1: $date1<br /> Date 2: $date2<br /> Date 3: $date3<br /> <p> </p> "; for($i = 1; $i <= 500; $i++) { echo"$i "; } ?> I would really appreciate your help, I am sure if I can see it work it will start to make sense ( I hope!).
It's not making sense, can you please explain bit more where you want break ? or you want line break or you just want to break loop ?
sorry, I am not sure how to explain these things yet, I need a line break after every 25 1 2 3 ........ 25 26 27 28 .......50 does that make sense?
<?php $date1 = date('l F j, Y'); $date2 = date('d/m/Y'); $date3 = date('d/m/Y H:i:s'); echo" Date 1: $date1<br /> Date 2: $date2<br /> Date 3: $date3<br /> <p> </p> "; for($i = 1; $i <= 500; $i++) { echo"$i "; if($i%25 == 0) { echo "<br />"; } } ?> PHP: just added if($i%25 == 0) { echo "<br />"; } what this does is divide $i with 25 and take what´s left over and compares it to 0.. In other words when $i / 25 breaks into even pieces like 1, 2, 3,4,5,6,7,8 and so on it returns 0