Most PHP programs are written in the traditional style (old school) of programming. You create functions to manipulate different pieces of data, and you call those functions during the "main" execution phase of your program.
PHP also offers object-oriented programming (OOP), which is now the preferred method of creating large programs. Java and C++ are object-oriented programming languages. OOP takes data and treats it like a "think."
Think of a car. A car is an object that has properties (color, make, model) and various states (parked, in reverse, going X miles an hour). Using OOP, you can manage your data more easily if your data mimics "objects."
Objects are created and managed through structures called classes. The data is manipulated within these classes with structures called methods. In reality, methods are nothing more than functions, yet they can work only within the confines of the class in which they are contained.
Comments
Be the first to write a comment
You must me logged in to write a comment.