You need to use the $this keyword in your PHP script. How would you do this?

  • $this
  • $self
  • $current
  • $object
In PHP, to use the $this keyword, you would directly reference it as $this within a class method. The correct option is "$this." The $this keyword refers to the current instance of the class and allows you to access its properties and methods. It is used to distinguish between class members and local variables or parameters with the same name. For further details, refer to the PHP documentation on the $this keyword: http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.class.this
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *