O'Reilly logo

Core PHP Programming, Third Edition by Leon Atkinson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Functions

Topics in This Chapter

You probably have noticed the use of several functions in the preceding chapters. Date and print are built-in functions that are always available for you. PHP also allows you to declare your own functions.

Functions expand the idea of repeating a block of code. They allow you to execute a block of code arbitrarily throughout your script. You declare a block of code as a function, and then you are able to call the function anywhere. When calling a function, you pass any number of arguments, and the function returns a value.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required