I wanted to know how files are included in php.
What I mean by that is that how the variables from the included files are imported and how the included file is able to use the variables from the main file.
I was creating a templating system and the problem was that I had an index file which included the other files such as config.php etc. But then depending on the page requested the index.php contained the template files too. But for some some reason I wasnt able to use the variables from the config file from in the template.php file
below is
vars.phpbelow is
test.phpsimple one from http://php.net/manual/en/function.include.php
declaring
global variablestake a look at this http://php.net/manual/en/language.variables.scope.php