|
Posted by Julien CROUZET on 10/10/65 11:39
mark a couché sur son écran :
> I have one very large include, which is an array. It's included when
> index.php is loaded. However, I now need to use the same include on
> page2.php, and page3.php and page4.php. Is there a smart way to do
> this and mimize load times on each sudsequent page?
You can serialize() your array and store it in a file, you'll get it by
using $MyArray = unserialize(file_get_contents("thefile.data"));
This file saving can be done with a $_SESSION, but I suppose the
array is the same for all visitors, so you probably don't need a
session
for that.
If you are really looking for an optimized way to include your array,
you can use an optimize like Turck MMCache, APC or AfterBurner which
'compiles' your include file and load it in shared memory.
Greetings,
--
Julien CROUZET - DSI Theoconcept
julien.crouzet@/enlever ca\theoconcept.com
http://www.theoconcept.com
[Back to original message]
|