Definition: A function is like a subroutine. It is a predefined set of commands that are executed when the function is called. Functions can be as simple or complex as desired, and can contain other functions within themselves. In the case of PHP, some functions come preprogramed and others you can define on your own.
Examples:
<?
SQRT (9);
// this function is predefined in PHP and performs the mathematical computation of square root. In this case would output the number 3 function examplefunction () //defining a function
{
print "Hi, I am a Function";
}
examplefunction (); //calling a function
// this function simply prints Hi, I am a Function when called
?>



