I have some files that I need to include in several pages so, I use something like
<html>
<head>
<title>This is a webpage</title>
</head>
<body>
<div>Hello, this is a webpage</div>
<?php include("header.html");?>
<div>Some more text.</div>
<?php include("BlockToInclude.php");?>
<div>Even more text.</div>
<?php include("footer.html");?>
</body>
</html>
The problem is that with each include();
I get a blank space of 20px before the included content. I get around this this by reducing the margin of the first included block by 20px, but I would prefer something that avoid this space instead of compensate it. Also, I'm kind of new to PHP, is this a normal behaviour or should I look for something I'm doing wrong?
UPDATE: I checked in the resulting code and in every spot where I called an insert();
function it appears an stranger character that is not in the original file (nor the caller or the included). I copied the code from the Firefox code viewer (where is not visible) to my editor (RJ TextEd in Windows) where it appears as a question mark in a box; if I save this code as an static html it renders the same, but if I delete those characters then the blank space disappears. Any thoughts?