jshpro2 wrote:
Sorry, I didn't realize bad design was part of your project requirements. To answer your question then the only ways to use global variables is to declare it global or access it through the $_GLOBALS super array. You could also use a registry which exploits an OOP feature called static variables to simulate what a global variable would do. If you really must use globals I would recommend a registry because then at least youre only dynamicaly coupling your code to the global variable, and not statically coupling it.
It is very important for me to use gloabal arrays & variables.
This is my project...
I have 22 variables or arrays that must be passed or used in 40+ different functions.
I know the technic to pass the vars like:
myfunction (v1,v2,...v22){
//code here
}
but it is a lot of code and not very easy to read.
(the project is a generic algorithm functionality in order to find forecast for tv viewers ratings)
Any suggestions ?!