Object-Oriented PHP


PHP can, if you want, be written in an object-oriented (OO) fashion. In PHP5, the OO functionality of the language has been enhanced considerably.

If you are familiar with other OO languages, such as C++ or Java, you may prefer the OO approach to programming PHP, whereas if you are used to other procedural languages, you may not want to use objects at all. There are, after all, many ways to solve the same problem.

If you are new to programming as well as to PHP, you probably have no strong feelings either way just yet. It's certainly true that OO concepts are easier to grasp if you have no programming experience at all than if you have a background in a procedural language, but even so OO methods are not something that can be taught in a ten-minute lesson in this book!

The aim of this lesson is to introduce how a class is created and referenced in PHP so that if you have a preference for using objects, you can begin to develop scripts by using OO methods. Most importantly, however, you will be able to pick up and use some of the many freely available third-party class libraries that are available for PHP from resources such as those at www.phpclasses.org, and those that are part of PEAR, which you will learn about in Lesson 25, "Using PEAR."



    Sams Teach Yourself PHP in 10 Minutes
    Sams Teach Yourself PHP in 10 Minutes
    ISBN: 0672327627
    EAN: 2147483647
    Year: 2005
    Pages: 151
    Authors: Chris Newman

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