PHP resources

Whether you're starting out in PHP or you're an advanced developer looking to add extra functionality, chances are you'll eventually try to hunt down some pre-developed, free classes/scripts that save on precious development time.

Below is a listing of what are generally perceived to be good PHP-class libraries.

Free PHP resources

ADODB - Database Abstraction Class (GNU LGPL License + BSD)

ADODB is a great class library that allows the developer to initiate connections to multiple database types using the same code. ADODB also allows the use of database sessions and performance monitoring. It's an effective time saver and allows your database applications to become more portable between different database types.

Currently, ADODB supports the following databases:

  • Interbase
  • Sybase
  • Oracle
  • Microsoft SQL server
  • Foxpro ODBC
  • Access ODBC
  • Informix
  • DB2
  • Sybase SQL Anywhere
  • generic ODBC
  • Microsoft's ADO.

Project page:

Smarty Templates (GNU Lesser GPL License)

Smarty is a popular template system that not only assists with separation of PHP and HTML, but also business logic with presentation logic. This means that you can create applications with visual appearance that can be radically changed by modification to template files. Smarty has a short learning curve and once mastered, allows the developer to create more advanced, portable applications.

Savant2 (GNU Lesser GPL License)

Savant is another template system, similar to that of Smarty. Savant, unlike Smarty, is based on the PHP language itself, meaning there's no template compiling overhead with less of a learning curve. Savant does come with a compiler, if you allow external editing to your templates, however it's not as robust as Smarty's compiler and really not needed if you and/or trusted users are the only ones editing templates. Savant can be installed independently or as a PEAR extension. Savant2 is compatible with PHP5 when error is set to ~E_ALL or less. Savant3 is compatible with PHP5 under ~E_STRICT.

HTML Purifier

HTML Purifier is an HTML filter library written in PHP. HTML Purifier defeats XSS with an audited whitelist while ensuring standards-compliant output, and is open-source and highly customizable.

PHPMailer – Mass mailing solution (GNU Lesser GPL License)

PHP mailer is a solution that allows the generation of emails based on PHP's mail() function or on SMTP server settings. Probably the best mass mailing solution for PHP, and easily integrated into existing code.

PHPSnips – PHP snippets (license unspecified)

PHPSnips is a snippet resource for all sorts of functions snippets and classes. It is all copy and paste, for snippets that can be used for private or commercial use. You can sign up to add/edit your own snippets. Alternatively, if you do not wish to sign up, you can still use the other functions, such as vote on the snippet's quality or comment on a snippet.

See also

Did this article answer your questions?

Article last updated .