Page 1 of 1

initializing same array across web pages

Posted: Sun Mar 06, 2011 3:25 pm
by sunnyment
i have a large array (1000 to 2000 elements) where each element has a unique value.
I need to reference this array in each web page.
My plan was to assign all the array elements in a file then include it in each page.

But it seems like this would take up a lot of processing when it repeats the array assignment for each page.
Is there a more efficient way to do this in php?

thanks in advance. :)

Re: initializing same array across web pages

Posted: Mon Mar 07, 2011 6:34 am
by internet-solution
You can load the array in a Session variable.

Re: initializing same array across web pages

Posted: Mon Mar 07, 2011 10:42 am
by AbraCadaver
internet-solution wrote:You can load the array in a Session variable.
Yes, but then there would be a copy of this array for every single user. Just include the file.