note 75166 deleted from language.basic-syntax by tularis
| From: | tularis@php.net | Date: | Mon, 21 May 2007 14:20:04 +0000 |
| Subject: | note 75166 deleted from language.basic-syntax by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-126796@lists.php.net to get a copy of this message | ||
Note Submitter: Geoffrey Thubron
----
It would appears that you cannot include a file that ends in the middle of control structure. For
example, suppose I have 3 files where the first is requested by the browser.
File 1:
<?php
include_once('header.php');
<p>some conditional content</p>
include_once('footer.php');
?>
File 2: header.php
<?php
$showpage = true; //or some really complex permissions condition
if ($showpage) {
?>
File 3: footer.php
<?php
} else {
<p>You cannot see this page right now.</p>
}
?>
This produces and error "Unexpected $end in header.php on line [last line]"