
Originally Posted by
freecrm
I have been advised that the best way to achieve this is using OOL or classes
The correct term is OOP - object oriented programming.

Originally Posted by
freecrm
Is anyone able to explain - in simple english - what a class is and how it might be applied to this process?
Class Confused() {
function PrintConfusion() {
echo "what the hell?";
}
$weird<=Confused();
echo $weird;
}
Your syntax is already wrong - Class Confused(){...} should not have any parentheses, it should be Class Confused {...}.
A class is simply a user-defined data type. Instead of saying a variable is a number or a string, you can define it as something more abstract. It can be a number, a string, or even run functions. You essentially are creating an object with lots of properties.
So if you want to store facts about your users using your webpage, you might want to create a class to store their name, age, etc:
Code:
Class User{
public $name;
public $age;
public $race;
public $gender;
}
That's the framework, now to create a "User" variable you would say something like:
Code:
$usernumber1 = new User();
$usernumber2 = new User();
And you could set the names that belong to that users doing this:
Code:
$usernumber1->name = "vol7ron";
$usernumber1->gender = "male";
$usernumber1->gender = "25";
$usernumber2->name = "freecrm";
$usernumber2->gender = "male";
$usernumber2->gender = "15";
You see?
This gets more cool when you embed functions into the class:
Code:
Class User{
public $name;
public $age;
public $race;
public $gender;
public function toOneHundred()
{
return (100-$this->age);
}
}
So using our above example the outputs would be 75 and 85, respectively:
Code:
echo $usernumber1->toOneHundred();
echo $usernumber2->toOneHundred();
Hope this isn't too complicated.