10. Creating Functions
In This Chapter
Creating and Using Simple Functions
Creating and Calling Functions That Take Arguments
Setting Default Argument Values
Throughout this book, you’ve used dozens of functions that provide much-needed functionality, such as date(), setcookie(), and number_format(). Although those functions have already been defined by PHP, here you’ll be creating your own. However, functions you’ve created and those built into PHP are used in the same manner.
Defining your own functions can save you oodles of time as a programmer. In fact, they constitute a big step in the process of creating web applications and building a solid ...
Get PHP for the Web: Visual QuickStart Guide, Fifth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.