Multiple inheritance in PHP?

Inheritance is a well-established programming principle, and PHP makes use of this principle in its object model. This principle will affect the way many classes and objects relate to one another. For example, when you extend a class, the subclass inherits all of the public and protected methods from the parent class. Unless a class…

Read More

PHP -Building Blocks

If –else statements: if…else statement – executes set of codes if a condition is true and another code if the condition is false Within a statement, if a certain condition is true, then something happens. Otherwise, something else happens. We can continue adding else statements as many times as we need. So, within PHP statement,…

Read More

The For Loop

PHP for loop can be used to traverse set of code for the specified number of times. For example if you want to repeat something ten or twenty times. It should be used if number of iteration is known otherwise I recommend you to use while loop. Syntax: for (Initialization; Condition; Progressive) { //set of…

Read More

PHP Superglobals

We already learned about variables, but there are some Readymade or predefined keywords in PHP that can be used without you having to create them first. Predefined or Superglobals variables are used to provide information from and about the web server, the web browser, and the user. There are several types of Super Global Variables:-…

Read More