Chapter 5

Object-Oriented PHP Programming


check Defining object-oriented programming

check Creating objects

check Using objects

check Customizing objects

So far, all the PHP scripts presented in this minibook have followed the procedural style of programming. With procedural programming, you create variables and functions within your code to perform certain procedures, such as storing values in variables, and then checking them with conditional statements. The data you use and the functions you create are completely separate entities, with no specific relationship to one another. With object-oriented programming, on the other hand, variables and functions are grouped into common objects that you can use in any program. In this chapter, you learn what object-oriented programming is and how to use it in your web applications.

Understanding the Basics of Object-Oriented Programming

Before you can start working on object-oriented programming (OOP), you need to know how it works. OOP uses a completely different paradigm from coding than what I cover earlier in this minibook. OOP requires that ...

Get PHP, MySQL, & JavaScript All-in-One For Dummies now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.