PHP

35
1223 reads

February 14, 2013

Basic Inheritance


Inheritance is used in PHP to use the functionality of One class in another class. It greatly reduces the Code Redundancy and increase the efficiency.
30
374 reads

February 14, 2013

Accessing Private Members


Sometimes it is needed to use the private members and assign them new data. So this example show how to do that.
26
384 reads

February 14, 2013

Method Visibility Scope in Other Class


Constructor of a class is also inherited because it's public by default. Example shows that which methods can be accessed in the inherited class.
33
365 reads

February 14, 2013

Effect of Property Visibility in Other Class


Shows the effect of Property Visibility in other classes.
29
397 reads

February 14, 2013

Method Visibility


Class methods may be defined as public, private, or protected. Methods declared without any explicit visibility keyword are defined as public.
30
379 reads

February 14, 2013

Property Visibility


Class properties must be defined as public, private, or protected. If declared using var, the property will be defined as public.
73
1486 reads

February 13, 2013

foreach loops


an example to show how to use simple foreach loop

310
4561 reads

February 13, 2013

while loops


example shows how to use while loop and do while loop

241
3747 reads

February 13, 2013

for loops


this is a simple for loop that prints from 1 to 10

37
1514 reads

February 13, 2013

Destructors


Destructors are used when we have to release the memory that the object have taken when it is initialized.