i use classes to organize my code and for re-use mostly. it's also much easier to work with class variables when you are writting your scripts (outside the class) because you don't have to worry about the variables being used by something else in your script.
i will generally make one class do all my data managment. basically everything that manipulates data without printing anything to the screen, .. then i will make an extention class that does all the printing.
lets say i just created an ecommerce site.. the engine of the site is in a "store" class. then i make an extension class called "display" .
if i ever want to create another ecommerce site, i can just use the "store" class. if i want the new store to have a different look, i can just make a new display class .. otherwise, i will use the same display class.
it is more of a workflow thing for me. working with objects is much more organized for me to code with. i didn't realize how great oophp was until i started using it. now i couldn't imagine programming without without it.
<?
class person
{
function person($name)
{
set_name($name);
$this->favorite_language="PHP";
}
function set_name($name)
{
$this->name=$name;
}
}
$me = new person("mike");
echo "my name is " . $me->name . "<br>";
echo "my favorite language is " . $me->favorite_language . "<br>";
?>
just a small example: if you have a function in the class that is named the same as the class itself "person()" , then that function will execute as soon as the object is created. '$me = new person("mike") '
don't know if i answered your question, but this is just some stuff off the top of my head. don't fear oop, it is great =)