For example I have 3 files:
First index.php with following code :
<?php
include("includes/vars.php");
include("includes/test.class.php");
$test = new test();
?>
then vars.php with following code:
<?php
$data = "Some Data";
?>
and last test.class.php
<?php
class test
{
function __construct()
{
echo $data;
}
}
?>
When I run index.php the Some Data value from $data variable is not displayed, how to make it to work?