PHP loop does not write text sequentially
Here is my code snippet:
foreach ($row as $key => $val) {
echo "<div class='jmp'><b>". htmlentities($key).": </b><br>"
.htmlentities($val)."</div>\n";
}
Oddly enough, PHP sometimes displays 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>
Notice that the ending <is missing a "b" in the middle? What is causing this? There are 500 records in the database. Even more perplexing, it is consistent. When I refresh the page, this error on that particular line will go away, but an identical error will appear on other lines. This completely breaks strict XHTML parsing.
+3
source to share