Introduction to PHP OOP

What is PHP?

  • PHP stands for hypertext preprocessor.
  • It is widely used in backend programming language.
  • PHP programming patterns are procedural/core php and object oriented.
  • Lots of framework are use like laravel, CakePHP, Yii, Zend, Codeigniter etc.
  • Code more modular and reusable.
  • Well organised code.
  • Easier to debug.
  • Best for large website projects.

Why is it so popular ?

  • Code reusable
  • Easier to debug
  • Best for medium and large website project
  • Backend programming use
  • Code more modular
  • Understanding code easier

What are class and object ?

  • Class are the blueprint of object ; Object use blueprint to build their project or functions.
  • Class example :- blueprint of house ; Object example :- built house.
  • Class function one ; Object function are lots that are related to class function.
  • If there is a function which is written in object but not written in class then that function will not work.

What is properties and methods ?

properties like :-

$a;
$b;
$c;
$d;

Methods like :-

sum(){
$c=$a+$b;
return $c;
}

Example of PHP :-

Tagged : / / / / / / / / / / / /

Leave a Reply