You’re no doubt familiar with using functions in PHP. The language contains hundreds of built-in functions that you can use for all sorts of handy jobs — from manipulating text through to reading files, sending email messages and processing images.
You’re not limited to using just the predefined functions, though — you can create your own functions too! In this tutorial, I’ll show you how. You’ll learn:
- Why it’s good to create your own functions
- How to create and use a function
- How to make your functions flexible by using parameters
- All about optional parameters and default values, and
- How to return values from your functions.
Ready? Let’s get started!
[Read more…] about Make Your Own PHP Functions: The Newbie Guide