PHP System Functions
PHP Functions
We will now explore how to create your own functions.
To keep the script from being executed when the page loads, you can put it into a function.
A function will be executed by a call to the function.
You may call a function from anywhere within a page.
A function will be executed by a call to the function.
Give the function a name that reflects what the function does
The function name can start with a letter or underscore (not a number)
A simple function that writes a name when it is called:
PHP Functions - With Parameters
Adding parameters...
- To add more functionality to a function, we can add parameters. A parameter is just like a variable.
- Parameters are specified after the function name, inside the parentheses.