What is a function?
- A function is a named block of code that defines a particular algorithm to solve a certain problem.
- A function can take extra information in order to solve a given problem. A function can give back a result after performing its task.
- A function can be recursive (a function that calls itself until a certain condition )
Types of functions
There are two types of functions in PHP:
- Built-In functions: A function that is already defined in PHP framework
- User-defined functions: A function that is defined by a user who uses PHP framework.