Next Previous Contents

9. Functions

9.1 Function Definitions

Function declarations follow the BSD style.

Example:

<?php
function fooFunction($arg1, $arg2 = '')
{
    if (condition) {
        statement;
    }
    return $val;
}
?>

9.2 Function Calls

Functions should be called with no spaces between the function name, the opening parenthesis, and the first parameter; spaces between commas and each parameter, and no space between the last parameter, the closing parenthesis, and the semicolon.

Example:

<?php
$var = foo($bar, $baz, $quux);
?>


Next Previous Contents