How can methods in PHP classes access properties of the main object when called from within another method?

To access properties of the main object within a method of a PHP class, you can use the `$this` keyword. When a method is called from within another method of the same class, `$this` refers to the current object instance, allowing you to access its properties directly.

class MyClass {
    private $property = 'value';

    public function getProperty() {
        return $this->property;
    }

    public function setProperty($newValue) {
        $this->property = $newValue;
    }
}

$obj = new MyClass();
echo $obj->getProperty(); // Output: value
$obj->setProperty('new value');
echo $obj->getProperty(); // Output: new value