Re: passing variables to object

From: Date: Fri, 21 Jul 2000 09:50:25 +0000
Subject: Re: passing variables to object
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-7539@lists.php.net to get a copy of this message
just remove your $ before the variiable name when you are using $this ex: $this->user ------------------ Jo Henrik Endrerud jhe@ez.no On Fri, 21 Jul 2000, you wrote: > Hi I have a problem with one of the objects, when I pass more than one > variable to the object and than try to access it I am only able to get the > last one. > > Object is this: > > class information > { > var $user,$first; > > function counselor_information($user_id,$first_name) > { > $this->$user = $user_id; > $this->$first = $first_name; > } > > function get_userid() > { > return $this->$user; > } > > function get_firstname() > { > return $this->$first; > } > } > > Here is call to the function that populates and than return the array of > objects.

« previous php.general (#7539) next »