PDA

View Full Version : Mimic ASP's "Application variables" in PHP


Frank
05-23-2006, 12:07 AM
Anyone experienced with ASP programming knows how useful Application Variables in ASP can be. However, ASP programmers who move over to PHP will be disappointed to find that PHP does not have any equivalent to ASP's Application Variables. This can be a problem if you have small bits of data that you wish to be common for all users of your script. This was the situation I ran into recently, and after a bit of searching, I discovered this workaround that essentially allows PHP to mimic ASP's Application Variables. It uses flat text files to store information which can be easily accessed and modified from any PHP script that includes the code on the following page.

http://www.leosingleton.com/projects/code/phpapp/