I''m collecting some sample code here. I''ll be adding to it as I go along, making sure I''m not trampling on anyone''s toes.
Some very simple Class interaction:
<?php
$mybox = new House("Jack");
echo $mybox->get_what_era();
class House
{
var $contents;
function House($contents) {
$this->contents = $contents;
}
function get_what_era() {
return $this->contents;
}
}
class Garden extends House
{
var $size;
function Garden($contents, $trees) {
$this->contents = $contents;
$this->tree = $trees;
}
function get_trees() {
return $this->tree;
}
}
$house1 = new House("Tudor");
$house2 = new House("Georgian");
$house3 = new House("Victorian");
$house4 = new House("Modern");
echo $house1->get_what_era() . "<br />";
echo $house2->get_what_era() . "<br />";
echo $house3->get_what_era() . "<br />";
echo $house4->get_what_era() . "<br />";
$mybox = new Garden("Lincoln Era", 10);
echo $mybox->get_what_era() ." - ";
echo $mybox->get_trees();
?>
