PHP - Forloop
Help to fix this for loop.
Code: [Select] for ($i = 0; $i <= 9; $i++) { if ($match[' . $i . '] == "H") { $drDisWins++; } } Similar TutorialsOkay, here is my code, it's messy but i will show u what needs to be done if u can help me Code: [Select] $uservalue=$user['max_stars']; $numCols = 8; $numPerCol = ceil(75 / $numCols); echo "<table class=tuble><tr>"; for($col = 1; $col <= $numCols; $col++) { $numerals = array(1=>'I','II','III','IV','V','VI','VII','VIII'); echo "<td><dl><dt>{$numerals}</dt><dd>"; for($row = 0; $row < $numPerCol; $row++) { $resultRow = 75; if ($i<=$uservalue) { if ($i == $selected) { $checked = 'checked'; }else{ $checked = ''; } echo '<label for="s'.$i.'"><input type="radio" id="s'.$i.'" onclick=\'showPreview('.$i.')\' value="'.$i.'" '.$checked.' name="form[star]"><img src=img/icons/'.$i.'.png></label><br>'; } else { if ($i > 75){ $lol = array("hey","hey2"); foreach ($lol as $lols){ $lol .= $lols; } echo '<font color=#f36f6f><span class=desc><b><img src=img/icons/'.$i.'.png> Confidential</span></b></font><label for="s'.$i.'"><input type="radio" id="s'.$i.'" onclick=\'showPreview('.$i.')\' value="'.$i.'" name="form[star]" disabled></label><img src=img/lock2.png><br>'; }else{ echo '<label for="s'.$i.'"><input type="radio" id="s'.$i.'" onclick=\'showPreview('.$i.')\' value="'.$i.'" name="form[star]" disabled><img src=img/icons/'.$i.'.png></label><img src=img/lock.png><br>'; } } $i++; } echo "</td>"; } This code he Code: [Select] $numerals = array(1=>'I','II','III','IV','V','VI','VII','VIII'); echo "<td><dl><dt>{$numerals}</dt><dd>"; for($row = 0; $row < $numPerCol; $row++) { I need to echo out that $numerals array onto my $numerals variable, but I cant because it's under a for loop, and if i try using a foreach it wont display correctly. because it's already under a forloop Any idea guys? |