[prev] [index] [next]

Functions

Functions are defined as:

function FuncName($arg1, $arg2, ... )
{
   Statement; ...
   return Expression;
}

Example:

// return array of first n integers
function iota($n)
{
   for ($i = 1; $i <= $n; $i++)
      $list[] = $i;
   return $list;
}