coolant Posted July 21, 2007 Share Posted July 21, 2007 (edited) n/m - please delete. Edited July 21, 2007 by coolant Link to comment Share on other sites More sharing options...
0 bkellner Posted July 21, 2007 Share Posted July 21, 2007 I'm trying to create this :012012012012012 I know I can use something like this: if(($m & 1) == "1"){ echo "1"; } else { echo "0"; } for 2 numbers, but how could I do 3? Thanks! while ($i <= 5) { $m = 0; if ($m++ == "1") { echo "0"; } else if ($m++ == "2") { echo "1"; } else { echo "2" } $i++; } This will loop though the if conditionals 5 times ($i), and each time setting $m as 0 before it processes it. This will give you the output exactly how you wanted. Link to comment Share on other sites More sharing options...
Question
coolant
n/m - please delete.
Edited by coolantLink to comment
Share on other sites
1 answer to this question
Recommended Posts