Functions act as a machine that takes a specified input and returns an output.
In most coding languages, there are pre-defined and user-defined functions.
Pre-defined functions are functions that are native to the language and don't require the developer to define.
Some examples of this in PHP are: stlen (string length), phpinfo, date, etc.
User-defined functions are functions that are created by the developer. User-defined functions can be very powerful, or very basic, depending on the use case.