Warrior Forum - The #1 Digital Marketing Forum & Marketplace

Warrior Forum - The #1 Digital Marketing Forum & Marketplace (https://www.warriorforum.com/)
-   Programming (https://www.warriorforum.com/programming/)
-   -   PHP Global Variables (https://www.warriorforum.com/programming/126966-php-global-variables.html)

WarrenW 22nd September 2009 11:16 AM

PHP Global Variables
 
I'm developing an e-commerce site involved with a lot of database access and naturally I want to keep the DB access to a minimum. Keeping some information in a server buffer definitely helps. I do have about 10 PHP script files for the entire site. Do you know if variables declared outside of functions in PHP modules are considered as global variables and accessible from any executing PHP scripts? Thanks,


Warren

TristanPerry 22nd September 2009 11:27 AM

Re: PHP Global Variables
 
If they are declared outside any functions or loops then yes, they'd be considered as global vars and could be used anywhere (as far as I know) :)

warrich 22nd September 2009 12:25 PM

Re: PHP Global Variables
 
you can use php.ini in your root directive to override server php.ini setting not sure about my.cnf file

LudwigReithofer 28th September 2009 01:24 AM

Re: PHP Global Variables
 
Look at:

Universally Accessible Data in PHP | EvanBot

PHP configuration patterns

cu Ludwig


All times are GMT -6. The time now is 12:09 AM.