The OOPs concept of Encapsulation in PHP means, enclosing the internal details of the object to protect from external sources. It describes, combining the class, data variables and member functions that work on data together within a single unit to form an object. Otherwise, its the bundling of properties and behavior in a single class unit.
Advantages of Encapsulation:
1) Data Hiding and Abstraction
2) Data security
3) Reduces complexity
4) Reusability
5) Reliability
6) Increased flexibility
Access Modifiers
Public, Protected,private