www.pickatutorial.com Computer Tutorials
Top eBooks: C/C++ | C# | Android | Mathematics | Database | Cloud | Graphics | Networking | Oracle | Hardware | AI
Top Tutorials: C/C++ | C#.NET | PHP MySQL | Java | Java Script | jQuery | HTML | xHTML | HTML5 | VB Script| CSS
Lessons PHP Classes and Objects Bookmark and Share
Lesson 1
Lesson 2
Lesson 3
Lesson 4
Lesson 5
Lesson 6
Lesson 7
Lesson 8
Lesson 9
Lesson 10
Lesson 11
Lesson 12
Lesson 13
Lesson 14
Lesson 15
Lesson 16
Lesson 17
Lesson 18
Lesson 19
Lesson 20
Lesson 21
Lesson 22
Lesson 23
Lesson 24
Lesson 25
Lesson 26
Lesson 27
Lesson 28
Lesson 29
Lesson 30
Lesson 31
Lesson 32
Lesson 33
Lesson 34
Lesson 35
Lesson 36
Lesson 37
Lesson 38
Lesson 39
Lesson 40
Lesson 41
Lesson 42
Lesson 43
Lesson 44
You may have heard that PHP is an object oriented programming language. PHP fully supports the concepts of classes, objects and inheretence. This makes PHP a really very powerful programming language.

Classes and objects in PHP are very similar to Java. A variable of the desired type is created using the new operator. Just like Java, PHP supports single inheritance only and uses the keyword extends to inherit from a super class. The inherited methods and members can be overridden, unless the parent class has declared a method as final.

A simple PHP class is defined as under:

<?php
class Student {
var $name; // name of the student
var $class; // class of the student
var $GPA; // GPA of the student
function printName() {
echo $this->name;
}
function printClass() {
echo $this->class;
}
function printGPA() {
echo $this->GPA;
}
}
}
?>

Next: PHP $_get


Home - Advertise - Contact - Disclaimer - About Us
© Since 2006 pickatutorial.com -- All Rights Reserved.