O'Reilly logo

PHP by Robin Nixon

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

Images

Writing Functions

Images To view the accompanying video for this lesson, please visit mhprofessional.com/nixonphp/.

In addition to using conditional constructs and statements such as if() and switch() as well as loops such as while() and for(), there’s another way you can control program flow—by using functions. Functions are sections of code you call from any other part of code (or even the function itself, which is known as recursion), which then perform one or more actions and then return.

   When functions return, they may also return a value back ...

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