Concept of Encapsulation in PHP

Concept of Encapsulation in PHP

Concept of Encapsulation in PHP?

Encapsulation is an OOP (Object Oriented Programming) concept in PHP.

Wrapping some data in single unit is called Encapsulation. Encapsulation is used to safe data or information in an object from other it means encapsulation is mainly used for protection purpose.

In technology era, it is essential to maintain your privacy. So for the security reason, Sometime we make private method.

Private method means it can be accessed within same class. Outside, Class can't access private method of other class.That's why encapsulation is known as data hiding is the main advantage for encapsulation.

Second advantage of encapsulation is you can make the class read only or write only by providing setter or getter method.

Capsule is best example of Encapsulation. Capsule basically encapsulate several combination of medicines. Schoolbag is one of best example of Encapsulation. School bag can keep our books, pen etc.

So finally the concept of Encapsulation in PHP is hiding internal information of object to protect from the other object.

Phone: (+91) 8800417876
Noida, 201301
Attention Required! | Cloudflare

Sorry, you have been blocked

You are unable to access ressim.net

Why have I been blocked?

This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.

What can I do to resolve this?

You can email the site owner to let them know you were blocked. Please include what you were doing when this page came up and the Cloudflare Ray ID found at the bottom of this page.