Author: ShairyPortfolio
-

HTML Tables
In web design, tables are a good way to organize data into a tabular form. Table consist of rows and column. Horizontal lines are called rows and vertical lines are called column. Here are some Key Points to Remember: Tables are defined with the <table> tag. A table is divided into rows with the <tr> tag. (tr stands for…
-

PHP Interface
Interfaces allow us to specify what methods/functions of a class should implement. It’s quite easy to use a variety of different classes in the same way. When one or more classes use the same interface, it is referred to as “polymorphism”. <?php interface Course { public function showCourse(); } class Course1 implements Course {…
-

PHP Polymorphism
There are two types of Polymorphism; i.e. Compile time (function overloading) Run time (function overriding) But PHP “does not support” compile time polymorphism, which means function overloading and operator overloading. <?php class Course1{ public function showCourse() { echo “Course 1”; } } class Course2 extends Course1{ public function showCourse() …
-

PHP Inheritance
Way1 to inherit one class from another using the keyword extends <?php class Course{ protected $courseCode; public function getCode($newCourseCode) { $this->courseCode=$newCourseCode; } } class Subject extends Course{ protected $subjectName; public function getCourse($newSubject) { $this->subjectName=$newSubject; } public function showCourse(){ echo “Student enrolled for <b>”.…