May 2017
Beginner
552 pages
28h 47m
English
A function is defined with the function command, a function name, open/close parentheses, and a function body enclosed in curly brackets:
function fname()
{
statements;
}
Alternatively, it can be defined as:
fname()
{
statements;
}
It can even be defined as follows (for simple functions):
fname() { statement; }
$ fname ; # executes function
fname arg1 arg2 ; # passing args
The following is the definition of the function fname. In the fname function, we have included various ways of accessing the function arguments.
fname() ...