PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
this is wasteful, as the PHP engine is going to be creating a static array each time the page is requested. how do i tell the engine to execute this code only ONCE, when the page is initially loaded? and then make the array available for each request of this page made?
yep, i considered that, but that only marginally decreases the performance problem. you see, it would still be evaled for each new visitor.
the information is static both across requests for the page AND across visitors for the page. in fact, the contents of the array should never change at all, and it should only ever have to be be created once.
i'm a JSP developer usually - i'm looking for the equiv of the init method, which is run once (and only once) when a JSP or a servlet is first loaded/intrepreted.
there is no such method in a php script. Basically the script is executed from the beginning when invoked. There is no persistence between requests (save the cache and a few exceptions).