ok, about five minutes ago i decided to learn classes and delve into php's oop 
side.

what i came up with was this...

//start example code

class newsletter {
     function send ($email,$subject,$message) {
         if ($email) {
              echo("the following message was sent to: $email <br> subject: 
$subject<br><br> $message");
         }  
         else {
              echo("failure");
         }
     }
}
$new = new newsletter();
$new->send("[EMAIL PROTECTED]", "test class", "test class worked, i have passed 
and failed the test.");

//end code example

..and this seems to work fine, i could easily add  the mail function and insert 
real variables into send() but what i don't understand is i could also easily 
do this without a class... so i guess the real question is what are some real 
life examples of class usage and why is it used as  opposed to regular non oop? 
thank you for any input into the subject that you may have.

Reply via email to