2. PHP Class Inheritance

This simple tutorial is for showing how class inheritance works in PHP and also provide a simple Object Oriented Programming (OOP) concept. To put things simply, class inheritance means a class can be inherited by a child class. A child class would inherit all the variables & functions the parent class has. Plus a child […]

Sending Email in PHP (Example)

If you configured the SMTP hosts in php.ini, you can easily send email via PHP. Simply use the mail() function in PHP and put in the parameters for email to, subject, email, and header information. //send email to $email_to = "somebody@somewhere.com"; //subject of email $email_subject = "Test Subject of the email"; //Email is from $header="from: […]

1. PHP Class Introduction

I am going to show the simplest class in PHP. (See the embedded comments for detail. It’s very easy to understand.) This is the php class code (filename is contact_info.php) class contact_info { /* declare some class properties as variables */ var $name; var $phone_number; var $note;   /* Constructor is simply a function with […]