Loading video...
User-Defined Functions
- Defining a function requires four parts:
- the function keyword
- a function identifier
- a function parameter list
- a function statement group, or ‘function body’
- Function parameters are variables defined in a function’s definition that can be used within the function’s body. They are initialized by arguments passed to the function each time it is called.
- Return values of functions are specified using a return statement.
- Return values can be of any PHP data type. If a return statement is never executed within a function, NULL is returned.
- The include_once construct functions exactly as an include statement, except that if the file specified has already been included it will not be included again. require_once functions like a combination of include_once and require .
- Additional Resources:
User-Defined Functions
Lecture Slides are screen-captured images of important points in the lecture. Students can download and print out these lecture slide images to do practice problems as well as take notes while watching the lecture.



































Start Learning Now
Our free lessons will get you started (Flash® 10 required).
Sign up for Educator.comGet immediate access to our entire library.
Features Overview