O'Reilly logo

Sams Teach Yourself PHP, MySQL® and Apache All in One, Fifth Edition by Julie Meloni

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 7. Working with Functions

In this chapter, you learn the following:

How to define and call functions from within your scripts

How to pass values to functions and receive values in return

How to call a function dynamically using a string stored in a variable

How to access global variables from within a function

How to give a function a “memory”

How to pass data to functions by reference

How to verify that a function exists before calling it

Functions are at the heart of a well-organized script and make your code easy to read and reuse. No large project would be manageable without them because the problem of repetitive code would bog down the development process. Throughout this chapter, you investigate functions and learn ...

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