I’m trying to structure my first application in separate files as follows (the logic being that manipulation of an array in memory will be quicker than continually reading from file):
index.php - declares an array, and reads a text file (perhaps 150,000 lines of text ~ 3MB) into that array using a function in the included file functions.php. User clicks a link to continue to list.php
list.php - needs to manipulate the array declared in index.php, includes ‘functions.php’.
show.php - needs to manipulate the array declared in index.php, includes ‘functions.php’.
functions.php - contains functions accessible to all files.
I have no problem accessing the global array in functions php using the ‘global’ keyword but how can I access it in list.php and show.php which aren’t ‘included’ in index?
I guess I’m asking how can list.php and show.php share the same scope as index.php without being ‘included’ (and I suspect the answer is they can’t!) or is there a way to emulate a pointer to this global array?
TIA
Paul