@cwjacklin
It could be anything from the way the operating-systems handles files to the way your PHP editor saves files.
(Some of them trim trailing white-spaces, some don't).
It's best just to make sure there is no room for misinterpretation by not leaving white-spaces where they shouldn't be.
@cwjacklin
Anything outside <?php ?> tags is usually considered HTML by Apache and added to the output accordingly.
Consider this:
-
<html>
-
<head><title>Test</tile></head>
-
<body>
-
<table>
-
<?php
-
for($i = 0; $i < 5; ++$i) {
-
echo "<tr>";
-
for($j = 0; $j < 5; ++$j) {
-
echo "<td>", pow($j, $i), "</td>";
-
}
-
echo "</tr>";
-
}
-
?>
-
</table>
-
</body>
-
</html>
If nothing unless the echo statements made it to the output, this type of syntax could not be used.
And keep in mind that a HTML infused PHP code like that is often included. In fact, I'm pretty sure the Smarty template engine does a lot of that.