tags:

views:

677

answers:

3

Is there a standard way of dealing with globally scoped variables in PHP? Session scoped? From the research I've done, it looks like the options are mostly addons or external. APC might work, but would be limited to a single PHP instance and not so useful for a farm of servers. Memcached seems like it would work, but I was hoping to find something within PHP. Does its stateless approach keep there from being a standard method for handling this?

--Tim

A: 

You can do session variables with $_SESSION.

hasseg
+1  A: 

You can write your own session handler, like here

Vinko Vrsalovic
+1  A: 

A persistent layar is the only way to go with php. Either file based solution or database.

php natively doesn't provide any mechanism to do application scope variable.

paan