faqts : Computers : Programming : Languages : PHP : kms : Classes

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

14 of 24 people (58%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

How can I use a global variable inside a class?

May 16th, 2000 23:17
Nathan Wallace, Wico de Leeuw


It's exactly the same as accessing global variables in functions:

    class Globals {
         function show_self() {
             global $PHP_SELF;
             print $PHP_SELF;
         }

    }

should do the trick.