Chapter 9User-Defined Functions


9.1 What Is a Function?

We have already seen a number of PHP built-in functions to manipulate arrays and strings, perform tests on variables, display output, and more. PHP provides you with a large array of built-in functions to perform common tasks to save you the trouble of writing your own functions. As your programs become more sophisticated, you might find that the particular task you need is not handled by PHP or that you want to break your program into smaller units to make it more manageable. Then it is time to write your own functions, and this chapter will show you how. But first ...

Get PHP and MySQL by Example now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.