Hello Zenith, SNIP > However, I am now doing a project, using PHP, I decide to write some > modules, for frequestly used. How ever, these module, have to use some > variables, whose scope is originally on only the upper most level. > If using these way (global all var in each function, even not the > modules functions), > it is very inconivent, as I need to know which variable, should 'global' > it, if I use some module functions, > Is there any convient way to do so??? Globals in PHP differ from many other languages and PHP does not support name space. All global vars are not visible in function or class by default. ( Programmer must declare as global before using it) I recommed you to browse http://www.php.net/docs.php I recommend to set 'enable track vars' and 'disable register globals' in php.ini. If you done this in php.ini, programmer can only access variables from server, browser, etc as acciative arrays like $HTTP_POST_VARS, $HTTP_GET_VARS, $HTTP_SERVER_VARS, $HTTP_UPLOAD_FILES, $HTTP_SESSION_VARS,..... If you want to access POST data from user's browser you can write like function foo() { global $HTTP_POST_VARS; // do something } to access all data that are posted by POST method. (Except $HTTP_UPLOAD_FILES) Using $HTTP_* variables improves code readability I think PS: You can use $GLOBALS[] to access all global vars. Regards, -- Yasuo Ohgaki > > Zenith > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]