Here’s my code snippet:
foreach ($row as $key => $val) {
echo "<div class='jmp'><b>". htmlentities($key).": </b><br>"
.htmlentities($val)."</div>\n";
}
Oddly, PHP sometimes output like this:
<div class='jmp'><b>HDD_SIZE_GB:</b><br> 143.5</div>
<div class='jmp'><b>HDD_MODEL:b><br> SEAGATE STT14775 </div>
<div class='jmp'><b>HDD_SN:</b><br> 3LN3N0098271QL2</div>
Note that the the ending < is missing from “b” element in the middle? What is causing it? There are 500 records in DB. Even more puzzling, it is not consistent. When I refresh the page, that error in that particular row will disappear but the identical error will pop up in other rows. That totally defeats the strict XHTML parsing.
My comment as an answer:
Are you sure that is the raw output (try it on the command line, or with lynx)? Sometimes browsers will alter code…