Main Content

Accounts in PHP - an OO demo

Archive - Originally posted on "The Horse's Mouth" - 2008-06-19 19:42:32 - Graham Ellis

I've written a new demonstration in PHP ...

* a base class of line items for your accounts
* subclasses for bills and invoices you issue
* a sample application that takes a number of bill and invoice items and produces an accounts table and total

All in the ONE course file as a demo ... here.

For a "live" application, the classes would probable be held in a separate file so that they could be shared across between a whole lot of different pages, and of course they would use a lot more attributes and be populated from files or databases

The example will work equally well in PHP5 and PHP4, even though you'll have been told that the OO model has changed between the two version!