NYCPHP Meetup

NYPHP.org

[nycphp-talk] Dynamically write functions

Frank Wong frank_wong2 at informationideas.com
Fri May 13 10:30:11 EDT 2005


Ken Robinson wrote:

> You might want to re-think how you handle the globals in the first place.
>
> Since all global variables are stored in the $_GLOBALS super array, 
> why don't you either reference the global variables as an index of 
> that array ($_GLOBALS['variable_name']) or use the extract() function 
> at the start of each function to get variable names?
>
I was just lazy and didn't want to type all the $_GLOBALS[...] when I 
first developed the application.  Now I regret it.   :-(   The extract 
function is perfect!  I had never used it before.  That should solve my 
problems instead of using a function to write the globals into all other 
functions.  Thanks a bunch for all the help.





More information about the talk mailing list