Traditionally programs are made up of lines of code arranged in the order they will be used. Often there will be functions to hold commonly used code. Variables will be used to hold data and conditions and loops used to manipulate that data. This is known as procedural programming.
Object-oriented programming takes a different approach. Objects are created and they come with their own code. An analogy would be a person. That's an object. The object has two sorts of things built in. Properties (such as hair colour or state of hunger) and methods (such as walk, talk and eat). You do not need to tell this object how to eat because it comes with the code needed to do the job. In programming this has the advantage that, once an object has been created, you do not need to re-write the code.
Objects may also be known as classes.
A relevant example from JavaScript is the string object (an object which contains text). You can declare a variable and then use functions or lines of code to examine it or change it. Alternatively you can think of a string variable as an object. JavaScript string variables come with methods which might be useful including finding the length of the string or looking for text within that string. String objects also have a property "value" which is used to access the string itself.
Both PHP and JavaScript claim to be able to do object-oriented programming but JavaScript comes a bit closer to that than PHP. This site concentrates on procedural programming with PHP but mixes in some objects in JavaScript because that is the way JavaScript handles elements on Web pages.




