forumnz Posted January 26, 2008 Share Posted January 26, 2008 This should make the variable c2, c3, c2, c3, c2 etc, but only displays c2. $col = (($count++)%2==0)?"c2":"c3"; Whats wrong with it? Link to comment https://forums.phpfreaks.com/topic/87854-small-count-problem/ Share on other sites More sharing options...
hitman6003 Posted January 26, 2008 Share Posted January 26, 2008 Works fine for me: <?php $count = 0; for ($i = 0; $i <= 10; $i++) { echo (($count++) % 2 == 0) ? "c2 " : "c3 "; } ?> Link to comment https://forums.phpfreaks.com/topic/87854-small-count-problem/#findComment-449429 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.