What does the "->" symbol mean in PHP?
In PHP, the "->" symbol is used to access properties and methods of an object. When you see this symbol in code, it means that you are accessing a property or method of an object. This is essential for object-oriented programming in PHP. Example:
class Person {
public $name;
public function sayHello() {
echo "Hello, my name is " . $this->name;
}
}
$person = new Person();
$person->name = "John";
$person->sayHello();