Callback functions

Callback functions are called by PHP whenever a certain event happens. For example, when parsing XML, PHP can call a function every time it hits a tag, and you can define your own user function for the purpose of being called by PHP, then pass the name of the function to PHP. Callback functions invariably have strict requirements on the number of parameters they can take, as very often PHP will want to pass variables to your callback function for you to use.

We'll be covering individual cases of callback functions as required throughout this book - for now it is simply necessary that you understand what they are.

 

Next chapter: The declare() function and ticks >>

Previous chapter: Variable functions

Jump to:

 

Home: Table of Contents

Follow us on Identi.ca or Twitter

Username:   Password:
Create Account | About TuxRadar