Mega Code Archive
A Class with Public Properties
name = $name;
$this->code = $code;
$this->setName( $name );
}
function getProductString () {
return $this->productString;
}
function setName( $n ) {
$this->name = $n;
$this->productString = $this->name." ".$this->code;
}
function getName () {
return $this->name;
}
}
$item = new Item ("A", 5);
print $item->getProductString ();
?>