At 03:04 PM 1/5/2002 -0800, Chris Hall wrote:
>Just a quicky --
>
>I have yet to see anyone define an array within a class, yet if it is
>possible, would i be able to access that array with
>$this->array["variable"];?

I've designed a class that has a method that RETURNS an array, but it 
sounds like you want to define one of the properties of your class as an 
array, i.e.:

class testObject {

         var $testarray = array("firstindex" => "firstvalue",
                 "secondindex" => "secondvalue");

         ...

}

I haven't personally done this, but I can't see why it wouldn't be 
possible.  Then if you wanted to access it inside a method you should be 
able to the way you have described, like:

         function testMethod () {

                 return $this->testarray["firstindex"];
         }

Should work....why don't you give it a shot and see what happens? :)


-- 
PHP Windows 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]

Reply via email to