I am forever going up and down my code adding and removing globals to functions.
Is it possible to pass global variables inside global variables to functions to save defining them in each time in function? If not is there a better way to do this?
My aim is to have an index of global variables at the top of each page and not worry about having to defining them inside functions.
global $site; $site = "global $link, $create, $populate, $delete, $withdraw"; $host = ""; $username = ""; $password = ""; $database = ""; $link = mysqli_connect("$host", "$username", "$password", "$database"); function display() { global $site; // code } function populate() { global $site; // code } function create() { global $site; // code } function withdraw() { global $site; // code } //output