john Green PHP

Object Oriented PHP tutorial

Some basic syntax conventions before we begin should help you to read and understand Object Oriented PHP scripts a little better.

Camel Case

Camel case elements are joined without spaces with each element's initial letter capitalized within the compound and the first letter of the first word lower case. Camel Cigarettes

Examples:

$myVariable; $yourVariableNameHere; $anotherLongWindedExampleRightHere;

Using this type of convention will help you to recognize what type of object or variable you are looking at and it will become second nature over a short time.

Methods and properties

A property of a class is simply a variable that has been declared inside a class. A method is a function that has been declared inside a class. They are called properties and methods because they "belong" to a class and can be accessed according to their relevant access levels after you create an object of that class. An example of this will follow later on this Object Oriented PHP tutorial.

Next Page > >

Article by J C Green

This article was written for non-profit educational purposes. Comments? Suggestions? Rants or raves? E-mail me using the form on this website.