What is a Function?

A function is a set of PHP statements that accept one or more parameters and return a value.

Functions offer the ability to group together program code that performs a specific task into a single unit that can be used repeatedly throughout a program.

Functions come in two forms: those built into the language and those you define yourself.


Functions | What is a Function? | Defining a Function | Calling a Function | Passing Data | Variable Scope | Global Access | Setting Default Values for Arguments | Passing Arguments by Reference | Returning Values from Functions | Returning References from Functions | Static Variables | Creating Variable Functions | Creating Conditional Functions | Creating Functions within Functions | Include Files | Require Statement | Testing a Function | Type-Testing Functions | Handling Errors Returned by Functions
© 2008: Hann So
email: hso@voyager.deanza.edu