global variables & classes

From: Date: Sun, 29 Oct 2000 10:32:20 +0000
Subject: global variables & classes
Groups: php.windows 
Request: Send a blank email to php-windows+get-3575@lists.php.net to get a copy of this message
Hi ... I'm new to php, and I have a little problem : I declare an array in the main body of my script, I define a class which includes a function from where I would like to reffer to this array ... but I can't manage to access it :( Here is the code used : <? $priorities = array( 1 => "very low", 2 => "low", 3 => "normal", 4 => "high", 5 => "very high", ); // my array // class task { // ... // function display() // one of the class member functions //
    {
       echo $priorities(3); // does not echo anything :( //
    }
} $test = new task; $test->display(); ?> Thanks for help. John.

« previous php.windows (#3575) next »