How to increment a number by 2 in a PHP For Loop
问题 The following is a simplified version of my code: <?php for($n=1; $n<=8; $n++): ?> <p><?php echo $n; ?></p> <p><?php echo $n; ?></p> <?php endfor; ?> I want the loop to run 8 times and I want the number in the first paragraph to increment by 1 with each loop, e.g. 1, 2, 3, 4, 5, 6, 7, 8 (this is obviously simple) However, I want the number in the second paragraph to increment by 2 with each loop, e.g... 1, 3, 5, 7, 9, 11, 13, 15 I can't figure out how to make the number in the second