{
storeChar($inputChar);
}
Explain sections of code that aren't obvious.
//TAB is ASII 9
define (TAB, 9);
// change tabs to spaces in userName
while ($index=0; $index < count ($userName); $index++)
{
$userName [$index] = ereg_replace (TAB, " ",
$userName [$index]);
Function Declarations
As previously stated, functions should have a comment block explaining what they do
and their input/output. The function block should align starting at one tab from the left
margin unless the function is part of a class definition. Opening and closing braces should
also be one tab from the left margin. The body of the function should be indented two
tabs.
<php
/
doAdd
Adds two integers
Input: $a, $b
Output: sum of $a and $b
/
function doAdd($a, $b)
{
return(a+b);
}
?>
Compound Statements
Flow control primitives should be compound statements, even if they only contain one
instruction. Like functions, compound statements should have opening braces that start at
column zero relative to scope.