PHP has no concept of an "application", unlike ASP.Net. PHP is a scripting
language, and from the view of PHP, the "application" is the current file
plus anything include()d or require()d.
Your best shot is probably either just writing out everything to a file like
vars.inc.php which you include on all pages (and re-writing that file as
necessary), or storing the information in some sort of database if that
turns out to be more practical.
Some people may call this a shortfall, others just see it as a design
philosophy. ASP.Net is designed around applications and tasks, PHP is
designed around scripts and procedures. (And no, I don't mean to start some
tech flame war, or anything like that. I'm simply saying that ASP.Net has a
concept of applications in the sense of multiple source files compiled into
a single application, supports OOP fully etc, whereas PHP is extremely well
suited towards procedural programming and scripting, but lacks the
facilities for full OOP and the concept of an "application" as opposed to
simply a collection of code.)
"Nick" <nb********@hotmail.com> wrote in message
news:ce**************************@posting.google.c om...
In ASP you can create a variable that is accessible by all scripts in
an application.
Is this possible in PHP? Storing a multi-dimensional array in memory
has much greater performance benefits than storing in a database or
session (which just gets saved to disk anyway). Id like to have my
commonly used application variables in memory.
Is this possible or is it one of the few flaws of PHP?
-Nick