How to declare a global variable in PHP?

Charlie N

New member
Hi guys,

In PHP i have a array taken from a file. This is stored in a
$arrayResults = array('.......... [data])

but this is a rather large array and i dont want to have to pass it to every function that needs it
i need a way so that on declaration of this $arrayResults, this variable is available in every function that calls it.

so far google searches have came up with
GLOBAL $arrayResults;
$arrayResults = array('.......... [data])

but functions still cant seem to use the array... unless it is passed in as a variable

any help would be appreciated
thanks
 
Back
Top