Ugh, escape from PHP before outputting HTML and use single quotes for faster parsing:
Code:
<?php
$count = 0;
foreach ($user as $item) {
if ($result[$count] == "Win") {
$result3 = 'class="leftcolgreen"';
}
if ($result[$count] == "Loss") {
$result3 = 'class="leftcolred"';
}
if ($result[$count] == "Draw") {
$result3 = 'class="leftcolyellow"';
}
?>
<tr>
<td class="leftcol1">
<?php echo $day[$count]; ?>.<?php echo $month[$count];?>.<?php echo $year[$count];?></td>
<td class="leftcol2"><img src="./images/flags/au.gif" width="18" height="12"></td>
<td class="leftcol3"><?php echo $user[$count]; ?></td>
<td class="leftcol4"><?php echo $ladder[$count]; ?></td>
<td <?php echo $result3;?>><?php echo $result[$count]; ?> <?php echo $score1[$count]; ?> - <?php echo $score2[$count]; ?></td>
<td class="leftcol6"><a href="selectmatch.php?id=<?php echo $id[$count];?>"><img src="./images/profile.gif" width="11"></a></td>
</tr>
<?php
$count++;
}
?>
but if you are just looking for where the semicolon is getting inserted at, take a look at the highlight below.
Code:
<?php
$count = 0;
foreach ( $user as $item )
{
if ($result[$count] == "Win")
{
$result3 = "class=\"leftcolgreen\"";
}
if ($result[$count] == "Loss")
{
$result3 = "class=\"leftcolred\"";
}
if ($result[$count] == "Draw")
{
$result3 = "class=\"leftcolyellow\"";
}
echo "<tr>";
echo "<td class=\"leftcol1\">";
echo $day[$count];
echo ".";
echo $month[$count];
echo ".";
echo $year[$count];
echo "<td class=\"leftcol2\"><img src=\"./images/flags/au.gif\" width=\"18\" height=\"12\"></td>";
echo "<td class=\"leftcol3\">";
echo $user[$count];
echo "</td>;";
echo "<td class=\"leftcol4\">";
echo $ladder[$count];
echo "</td>";
echo "<td ";
echo $result3;
echo ">";
echo $result[$count];
echo " ";
echo $score1[$count];
echo "-";
echo $score2[$count];
echo "</td>";
echo "<td class=\"leftcol6\"><a href=\"selectmatch.php?id=$id[$count]\"><img src=\"./images/profile.gif\" width=\"11\"></a>";
echo "</tr>";
$count++;
}
?>
Hope this helps.
Bookmarks