It looks like I'm missing some basics here. Sorry, If question may seem trivial, but I'm loosing my wits looking for any cause of that, with no luck for hours now.
It seems like including more than one file in already included file is causing some minor change to the page layout. For this very simple example it just shifts first line a bit (like a space-character sign is added), but for my more complex site this "flaw" behaves like a line break and it puts whole website for a line down (breaking my website's style).
Here's example.
I have uber-simple main PHP file("include_test.php")
:
<?php require ("./file.php");?>
<!doctype html>
<html>
<head></head>
<body>
This is a first line of html body.<br>
This is a second line of html body.<br>
This is a third...<br>
</body>
</html>
Then required file - "file.php", looks like this:
<?php
require_once("file2.php");
require_once("file3.php");
?>
And then both required file above -file2.php and file3.php. It seems irrelevant here, as I can put any content there with no change, but either way they are such super simple php files -
file2.php:
<?php
function alfa(){
return 1;
}
?>
file3.php:
<?php
function omega(){
return 1;
}
?>
Now please look at the output of main "include_test.php: here:
http://destadesign.com/tag/include_test.php
Notice the slight shift of the start of the body content? What is causing this?
Note: I've worked out that removing any of the "require" statements fix this out. Remove second "require" statement of file.php "require_once("file3.php");" - fixed. Remove first "require" statement of file.php "require_once("file2.php");" - fixed. Remove "require" statement of include_test.php "require("file.php");" - fixed.
Conclusion (however weird) seems that two require statements (or include - as I've checked that too - or include_once, or require_once too) in the same file which is also included outputs some invisible, unexpected and unjustified character. Now is it correct or am I missing something obvious here ?