O'Reilly logo

PHP and MySQL Recipes: A Problem-Solution Approach, Second Edition by Frank M. Kromann

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

© Frank M. Kromann 2016

Frank M. Kromann, PHP and MySQL Recipes, 10.1007/978-1-4842-0605-8_11

11. Functions

Frank M. Kromann

(1)Trabuco Canyon, California, USA

Functions are a way to structure code that is used several times into a convenient structure. This is a great way to reduce code duplication and increase reusability. There are more than 1000 built-in functions in PHP and user-defined functions can be declared in the main script or in an include file, and it is up to the script developer to make sure the correct files are included before a function is called.

Recipe 11-1. Calling Functions

Problem

In chapter 2 we discussed the use of classes to build objects of data (member variables) and functionality (methods). Using a class to instantiate ...

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