PHP Posts

Login system in php source code For Beginners

Login system in PHP and mysqli



Today we are going to explore how to. create a login system using PHP. I have divided this post to 3 parts. We are going to set up our application and register the user. We are going to log out of the user and end-user session. And finally, we are going to log in using […]



PHP class constructor and destructor with example 2020



PHP out of the box provides us few magic methods. Constructor and destructor are the important magic methods. So when we create a class object (Initialize a class). It Constructor function fires automatically. Now when we delete the variable where we stored the class object refrence then destructor function fires. Have a look on this […]



What is Interface in PHP 7



What is Interface An Interface allow user to define public methods that a class must implement. Or in other words if a class “implements” a interface that class must use functions defined in “Interface”. We can have functions in interface without body similar to abstract functions. Here is the code example for Interface in PHP



What is the difference between public, private, and protected php7

What is the difference between public, private, and protected ?



In Object oriented programming we can define visibility as public, protected, private. So Public variables can be used inside or outside of the class. Whereas Protected and Private variables cannot be used outside of class. The deference between Protected and private Visibility. Private variable can be used inside of class where that variable is defined. […]



How to use Constants in php 7

How to define constant in PHP 7



What is Constants In PHP In Object Oriented Programming we can define constants. Mainly when you want to use some variables with some values and you want to make sure the value to that variable never changes then you use constant. Once value is defined to constant it cannot be changed. Here is how constant […]



Data encapsulation in PHP 7

Data encapsulation in PHP 7



What is Data Encapsulation Data Encapsulation also known as Data Hiding is a very vital object oriented programming concept. In this mechanism user can perform restricted set of operations of the class. So mainly in simple words we set variables to private then they can be used by functions but user cannot change values of […]



INHERITANCE IN PHP 7

INHERITANCE IN PHP 7



What is Inheritance In Object Oriented Programming inheritance is a concept of extending a class. So if you have a base class let’s say “Vehicle Class”. This class might have functions those can be applied to all vehicles such as wheels, colour, fuel etc. So if you create a child class named “Car class”. Then […]



Function overriding in PHP with simple example

Function overriding in PHP with simple example



What is Overriding Function overriding is a concept of Object Oriented Programming where we crate function with same name in parent and child class. And PHP calls the function from child class if function present in child class otherwise it looks in parent class. Here is the example In the code example you can see […]



Final class in PHP with example

Final class in PHP with example



What is Final Keyword The concept of Final keyword is important as we can restrict the use of class using this keyword. In Object Oriented Programming when you want to make sure that no one can extend the class you made you can add “Final” keyword in from of class. So this class will not […]



Abstract class in PHP simple example 2020

Abstract class in PHP simple example 2020



What is Abstract Class In Object Oriented Programming Abstract keyword is very useful. If we want to create a class that cannot be instantiated but can be extended then we add “abstract” keyword to that class. Abstract classes are mainly can be extended but cannot be instantiated. If the keyword extend is added in front […]




1 2