I try to use a variable in a included file.
In standart this work:
t1.php ->
<?php
$x = 100;
include_once(t2.php);
?>
t2.php ->
<?php echo $x; ?>
But if I build a loader between this two: to have a easyer handling, it don't work. This look like this:
t1.php ->
<?php
include_once("t3.php");
$x = 100;
load("t2");
?>
t3.php ->
<?php
function load($file){
$path = "./";
include_once($path.$file.".php");
}
?>
t2.php ->
<?php echo $x; ?>
Has someone an idea?