Inheritance in PHP:-

Inheritance is an important principle of object-oriented programming procedures. Inheritance provides you with many benefits that make PHP programming a lot more convenient. Using this principle, the relation between two classes can be defined. PHP supports inheritance in its object model.Inheritance in PHP

PHP uses extends keywords to establish relationships between two classes.

Syntax of Inheritance:-

class B extends A

Example:-

<?php  
class xyz  
    {  
        function expert()  
        {  
            echo "ESTS";  
        }  
    }  
    class pqr extends xyz  
    {  
        function experts()  
        {  
            echo "Blog";  
        }  
    }  
    $obj= new pqr();  
    $obj->expert();  
?>  

Inheritance in PHPexpoundsofttechsolution