Chapter 9. Creating Functions

I l @ ve RuBoard

On the same level of usefulness as regular expressions, but far easier to understand and implement, are functions. The functions I am referring to in this chapter are not exactly the same as those you have encountered up until this point, such as phpinfo() , count() , and eregi_replace() . Whereas those functions have already been defined by PHP, now you will be creating your own. However, once created, functions you have written and built-in PHP functions are handled in the very same manner.

Creating functions can save you oodles of time over the course of your programming life. In fact, they constitute a strong step towards creating Web applications and building a solid library of PHP code to use in future projects.

In this chapter, you will see how to write your own functions that perform specific tasks . After that, you'll learn how to pass information to the function, have your function return a value, and learn how functions and variables work together.

I l @ ve RuBoard


PHP for the World Wide Web (Visual QuickStart Guide)
PHP for the World Wide Web (Visual QuickStart Guide)
ISBN: 0201727870
EAN: 2147483647
Year: 2001
Pages: 116
Authors: Larry Ullman

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net