Mega Code Archive
Categories
/
Php
/
Class
Creating a Class That Inherits from Another
name = $name; $this->code = $code; } function getName() { return $this->name; } } class PriceItem extends Item { } $item = new PriceItem( "widget", 5442 ); print $item->getName (); ?>