name = $newName; $this->street = $newStreet; } public function display(){ echo "

Address Entry

\n"; echo "

\n"; echo "Name: " . $this->name . "
\n"; echo "Street: " . $this->street . "
\n"; echo "

\n"; } public function getName(){ return $this->name; } public function setName($newName){ $this->name = $newName; } public function getStreet(){ return $this->street; } public function setStreet($newStreet){ $this->street = $newStreet; } } ?> PHP Address Object

PHP Address Object

Create an object and display it.

display(); ?>

Change the object contents and display them.

setName("Jane Doe"); echo "

New name is: " . $anAddress->getName() . "

\n"; $anAddress->display(); ?>