PHP Function
In this chapter you will learn:
- What Is a Function?
- What is function parameter
- What is return value form a function
- Why Functions Are Useful
Description
A function is a self contained block of code that performs a specific task.
Parameter
A function often accepts one or more arguments, which are values passed to the function by the code that calls it.
The function can then read and work on those arguments.
Return
A function may optionally return a value that can then be read by the calling code.
In this way, the calling code can communicate with the function.
Why
Functions avoid duplicating code. They make it easier to eliminate errors.
Functions can be reused in other scripts. They help you break down a big project.
Next chapter...
What you will learn in the next chapter:
Home » PHP Tutorial » PHP Function Create