php java in memory database

Posted by msaif on Stack Overflow See other posts from Stack Overflow or by msaif
Published on 2010-05-04T12:35:51Z Indexed on 2010/05/04 12:38 UTC
Read the original article Hit count: 278

Filed under:
|
|
|
|

i need to load data as array to memory in PHP.but in PHP if i write $array= array("1","2"); in test.php then this $array variable is initialized every time user requests.if we request test.php 100 times by clicking 100 times browser refresh button then this $array variable will be executed 100 times.

but i need to execute the $array variable only one time for first time request and subsequent request of test.php must not execute the $array variable.but only use that memory location.how can i do that in PHP.

but in JAVA SEVRVLET it is easy to execute,just write the $array variable in one time execution of init() method of servlet lifecycle method and subsequent request of that servlet dont execute init() method but service() method but service() method always uses that $array memeory location.

all i want to initilize $array variable once but use that memory loc from subsequent request in PHP.is there any possiblity in PHP?

© Stack Overflow or respective owner

Related posts about php

Related posts about java