note 18748 modified in language.variables.scope by danbrown

From: Date: Mon, 18 May 2009 01:44:37 +0000
Subject: note 18748 modified in language.variables.scope by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-155590@lists.php.net to get a copy of this message
Quick tip for beginners just to speed things up: If you have a bunch of global variables to import into a function, it's best to put them into a named array like $variables[stuff]. When it's time to import them you just so the following; <?php function here() { $vars = $GLOBALS['variables']; print $vars[stuff]; } ?> This really helps with big ugly form submissions. --was-- Quick tip for beginners just to speed things up:<P> If you have a bunch of global variables to import into a function, it's best to put them into a named array like $variables[stuff]. <P> When it's time to import them you just so the following; <P> function here() { $vars = $GLOBALS['variables']; print $vars[stuff]; } This really helps with big ugly form submissions. http://php.net/manual/en/language.variables.scope.php

« previous php.notes (#155590) next »