my problem is in PHP.. I have an object location with attributes name,date,address and get and set methods... class location{ public $name; public $date; public $address; public function set_name($myname){ $this->name=$myname; } public function get_name(){ return $this->name; } } Then i created an array $locations_array=array();
i also created an instance of the class location:
$my_loc=new location; $my_loc->set_name("africa"); $locations_array[0]=$my_loc; echo $locations_array[0]->get_name(); when i try to echo the name of the object $my_loc..there's an error..how can i remedy this?