Answer:
A function is a set of commands. These commands usually call other, more basic functions and called one after the other they work together to archive a certain objective, sometimes simple, sometimes complex.
Say the purpose of the function is to erase all hyphen (-) and at (@) characters in some text. The function will is accept a parameter (the text) and return a value (the formatted text). Here's how that would look in the code...
function strip_slashes ($text) {
return str_replace(".", "", str_replace("@", "", $text));
}
This code creates a function called "strip_slashes", the function accepts the "$text" parameter and then runs the built in PHP function "str_replace" twice to replace the @ and - characters with nothing (effectively erasing them). In the same line we tell our function to "return" the results of our two "str_replace" functions.
PHP has over 700 built in functions able to do just about anything you can think of. If it's not there, likely because it's very specific to your application, then you can simple write it yourself.