What are the best practices for accessing variables in parent classes from child classes in PHP?

To access variables in parent classes from child classes in PHP, you can use the `parent` keyword followed by the scope resolution operator `::` or the `->` operator, depending on the visibility of the variable. If the variable is public, you can access it directly using the `->` operator. If the variable is protected or private, you can use getter and setter methods in the parent class to access and modify the variable.

class ParentClass {
    protected $variable = 'Hello';

    public function getVariable() {
        return $this->variable;
    }
}

class ChildClass extends ParentClass {
    public function displayVariable() {
        echo $this->getVariable(); // Accessing protected variable using getter method
    }
}

$child = new ChildClass();
$child->displayVariable(); // Output: Hello