Forum Moderators: coopster

Message Too Old, No Replies

storing variables outside a function..

currently I'm using session and I dont like it

         

Buzbe

12:14 am on Feb 17, 2005 (gmt 0)

10+ Year Member



I'm looking for a method to write to varible which doesnt need to be returned at the end of every function,

currently I'm achieving this by writing to the $_SESSION varible... is there another way to do this?

hakre

12:35 am on Feb 17, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



you can use global variables for that. instead of $_SESSION you can use $GLOBALS, working quite the same way.

Buzbe

9:18 am on Feb 17, 2005 (gmt 0)

10+ Year Member



werent globals disabled sometime in php4?

coopster

12:14 pm on Feb 17, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



register_globals [php.net] were disabled by default. But hakre is referring to the superglobal array, $GLOBALS [php.net].