Coding Standards:

These rules are not set in stone, however they are good general guidelines to follow for formatting, commenting, and quoting.

Formatting:

Formatting Example:
$bar = $function();
$foo = $function2();

if ($foo == '1')
{

  $bar++;

}
else
{

  $bar = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 -
   1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1;

}

Commenting:

Commenting Example:
// ******************************************************************
// test.php
// Functions Available:
//  - blah
//    (Gets the number '1'.)
//  - blah2
//    (Adds one to a number.)
// ******************************************************************

$bar = $blah();
$foo = $blah2($bar);

// **** blah Function ****
// Input: --
// Output: Number
// Description: Returns the number 1.
function blah()
{
  return 1;
}

// **** blah2 Function ****
// Input: A Number
// Output: A Number
// Description: Returns 1 + the inputted number.
function blah2($number)
{

  if ($number == 1) // Does absolutely nothing.
  {
    
    $number = 1;

  }
  else // Also does nothing.
  {

    $number = 1;

  }
  return $number + 1;
}

Quoting:

Quoting Example:
$bar = 'This is a standard string with single quotes';
$foo = "This is a string with a $bar variable so, it needs double-quotes";
$html = 'Even though this has a ' . $bar . ' variable, it also has <a href="www.w3c.org">HTML tags</a> so we must use single quotes.';