There are two types of programming

  • Procedural
  • Structural

Procedural programming is a programming having set of instructions or functions which executes step by step so procedural programs have only one module for one  and we have to track that which function is calling which function. To resolve this issue we have to introduce the Structural programming

Structural programming is a programming in which we work in different modules. It works on the principle “Divide and conquer”. As we know that any computer program is the set of tasks and if any task is too complex to understand and describe then we break it into small tasks till  it is easily understood. In this way the complex task become easy. This is called structural programming which is also known as Object Oriented Programming(OOP).

There are two benefits of OOP

  • Provide modular structure for our program
  • Make easy to maintain our existing code

In order to become a GOOD developer everyone should learn the OOP

These are the data types used in PHP

  • – Booleans (true or false)
  • – Integers (whole numbers)
  • – Floating point numbers(whole numbers with decimal points)
  • – Strings (String is anything)
  • – Arrays (it is a map or vector)
  • – Objects (instance of Class)
  • – Resources (File handling)
  • – NULL (just null)
  • – Callbacks (call over a function)

In this series we will only discuss the Objects in PHP

Here consider the following program


Now we can also assign the array to the variable.


In this tutorial we only learn how to use the class this is very basic of object oriented programming