note 120846 deleted from function.include-once by salathe
| From: | salathe@php.net | Date: | Mon, 21 Sep 2020 14:41:18 +0000 |
| Subject: | note 120846 deleted from function.include-once by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-215267@lists.php.net to get a copy of this message | ||
Note Submitter: sascha dot diebel at gmail dot com
----
i tried
-------------------------------- index.php:
$out='todo 1';
include 'file1.php';
$out='todo 2';
include 'file1.php';
echo 'end';
-------------------------------- file1.php:
include_once 'file2.php';
if(isset($out)){
echo $out;
}
-------------------------------- file2.php:
$out='first todo once';
include 'file.php';
the output is:
first todo once
first todo once
todo 2
what should i do?
if i would replace in file2.php include with include_once, then i have following output:
first todo once
todo 2
i could write
$out='first todo once';
include 'file1.php'
$out='todo 1';
include 'file1.php';
$out='todo 2';
include 'file1.php';
but i don't want :-)
please help