Justtechjobs.com Find a programming school near you






Online Campus Both


php3-list | 2000051

Re: [PHP3] Accessing global variables from within a class From: Richard Lynch (richard <email protected>)
Date: 05/15/00

In article <Springmail.105.958401598.0.26553700 <email protected>>,
vnath <email protected> wrote:

> I have been having difficulty accessing global environmental variables
like $PHP_SELF and $HTTP_USER_AGENT from within a class. Normally, to use
these values in functions you have to specify them as 'global', but I get
a parse error when I try declaring a global variable within a class
definition.

The global goes inside a function, not inside a class{}

You'll need it in every function that uses that variable.

-- 
Richard Lynch                | If this was worth $$$ to you, buy a CD
US Customer Support Director | from one of the artists listed here:
Zend Technologies USA        | http://www.L-I-E.com/artists.htm
http://www.zend.com          | (this has nothing to do with Zend, duh!)

-- PHP 3 Mailing List <http://www.php.net/> To unsubscribe, send an empty message to php3-unsubscribe <email protected> To subscribe to the digest, e-mail: php3-digest-subscribe <email protected> To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 To contact the list administrators, e-mail: php-list-admin <email protected>