I have variable, $db and more variables. I have a lot of includes, that in the beginning of the files, have
global $db;
and I want to define the variable $db and some more variables as global and remove the global from the beginning of the includes, that I'll have only the definition on the index file and not in the includes. for example: index.php:
$db = new DataBase;
global $db;
include "file.php";
file.php:
$db->select("...");
now file.php have "global $db;" for it will work, but I want to remove it, and leave only in the index.php
thanks for helping