"$this" what type of object it is?
Answers were Sorted based on User's Feedback
Answer / venky
$this represents the current working class.
if you are accessing the variable or function with in the
same class then $this represents the current working object.
for ex:
class Test{
function fn_testing($a)
{
$a++;
return $a;
}
$c=$this->fn_tesing(1);
}
Is This Answer Correct ? | 6 Yes | 1 No |
Answer / kapil dhiman
<?php
class DemoTesting{
public $val="India is great";
public function checkThis()
{
//$this-> object of current class
echo $this->val;
}
}
$obj= new DemoTesting();
$obj->checkThis();
?>
Is This Answer Correct ? | 5 Yes | 0 No |
How do you end a function in python?
What is php7?
Explain about image types in detail?
Which framework is best for php?
What is "echo" in php?
What is a lambda function in php?
How to send email using php script?
What is mod_php?
What is the purpose of the '.frm' file extension? What do thes file contain?
Explain about the $_GET variable of PHP?
Is it worth learning php in 2019?
What is .htaccessfile and use of this file