note 24884 added to function.include
| From: | dws at mrao dot cam dot ac dot uk | Date: | Tue, 03 Sep 2002 21:15:24 +0000 |
| Subject: | note 24884 added to function.include | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-36078@lists.php.net to get a copy of this message | ||
I've recently been doing some ASP (yech) programming, and found it useful to include files with
'open ended' conditional statements. In PHP it would be:
main.php:
<? require ("foo.php"); ?>
<h1>The condition is true</h1>
<? require ("bar.php"); ?>
foo.php:
<?
if (condition == true) {
?>
bar.php:
<?
}
?>
Unless I'm doing something wrong, this seems to cause a parse error in PHP which is a bit of a
pain if you want to keep the code in main.php to a minimum.
Naich.
--
http://www.php.net/manual/en/function.include.php
http://master.php.net/manage/user-notes.php?action=edit+24884
http://master.php.net/manage/user-notes.php?action=delete+24884
http://master.php.net/manage/user-notes.php?action=reject+24884