This is my first time using PHP (and programming for that matter) and I’m having trouble getting my code to output a simple 6X4 grid of numbers. Also, I’m having an issue with getting a “zero” to come up in front of the single digit numbers in the grid (1-9). Also, I am not supposed to use HTML Table coding to get this to work. Heres what I’m trying to accomplish…
01 02 03 04 05 06
07 08 09 10 11 12
13 14 15 16 17 18
19 20 21 22 23 24
Heres my current code and output:
<?php while($y<24) { $q=0; while ($q<06) { $y++; $q++; $number=q; echo $y."__"; } } ?>The previous code generates this:
1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_17_18_19_20_21_22_23_24_
Can anyone help me with this? This has bothered me for a while now and I’m desperate for help. Thank you.