PHPDoc

phpDocumentor is a tool written in PHP designed to create complete documentation directly from both PHP code and external documentation. The truth is, PHP source code is so lucid, it can practically serve as its own documentation. phpDocumentor taps into this fact by parsing out all kinds of logical structures already found in PHP, such as files, classes, functions, define constants, global variables, and class variables/methods and organizes them into a traditional manual format.

Installing PHPDoc

To install PHPDocumentor, go here to download it. Note: You must have the Apache Web Server installed to run PHPDoc on your local machine.

PHPDocumentor basics

The documentation process begins with the most basic element of PHPDocumentor: a Documentation block or DocBlock. PHPDocumentor generates manual-format documentation by reading it from special PHP comments called DocBlocks. Complete inline documentation comment blocks (docblocks) must be provided. The in-code documents in your DocBlocks must be written for both end-users and programmers wherever possible.

A DocBlock is an extended C++-style PHP comment that begins with /** and has an * at the beginning of every line. DocBlocks precede the element they are documenting. To document function "foo()", type:

/**  
  * Defies imagination, extends boundaries and saves the world ...all before breakfast!  
*/  
function foo()  {  }

See more instructions on DocBlock

Resources