OOP Concept
OOP Concept
Home Page )
79.2% websites are in PHP
0) Simple
1) Open Source(free available for every one)
2) Server side scripting language(writting code and implementing every thing is
done on server side)
3) Fast
4) Highly Flexible (small changes can be done without developer)
5) Interpreted (Interpreted language & doe not compile the entire code that take
less time to run means fast )
6) Create dynamic web Pages
7) Security Encryption
8) Cost Efficient
9) Compatibility(It works with different databases and Programming Languages)
10) Platform Independent(Does not require any plugins to run it can run on any
environment)
11) Large PHP Community (Old language it has grown up to large community)
Body Structure
<?php
Body part
?>
1)Class:- It is a Blue print of an object and provides initial values for the
state.It consist of both data and funtions.Data and functions together are called
an object.
when you define a class the variables used in it are called properties
and functions used in it are called methods.
2)object:- The instance of class is called an object. we can create many objects of
the same kind. A class is incomplete without an instance. e.g A car is a class and
its types like Mersedies, Toyota, and BMW are its instances.
Object of a class is created using a keyword "New". These are created
outside the class.
3)MemberVariables:- Defined within the class and the data can be accessed by member
functions alone. When the objects are created these variables are called the
attributes of an object.
4)MemberFuntions:- Defined within the class and are used to access object data. e.g
function set_name() and get_name().
7)Detructer:- This function is called when the object stops working. it start
with 2 underscores and a keyword destruct. e.g function --destruct();
8)Inheritance:-
9)Polymorphysm:-