When I use:
Code: Select all
<?php
require('myfile.php');
?>
If it is at the begging of the script, then it adds a new line at the beginning.
It doesn't matter whether I use require/include/require_once/include_once, it always adds new line
This is the content of the included file - file.inc:
Code: Select all
<?php
/*
Comments ...
*/
/* Comment ... */
date_default_timezone_set("Europe/Sofia");
$current_datetime = getdate(time());
define("TODAY", "${current_datetime["mday"]} ${current_datetime["month"]} ${current_datetime["year"]}, ${current_datetime["weekday"]}");
define("YEAR", "${current_datetime["year"]}");
?>
Code: Select all
<?php require_once 'file.inc'; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="bg" lang="bg">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
...
<table>My table content</table>
When I remove from file.php the part <?php require_once 'file.inc'; ?>, the emprty space disappears.
There is no lines after the closing tag "?>" in file.inc. There is nothing at least for me to tell me why this empty space in file.php appears