"$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 the web server interprets php and interacts with the client?
how many type of url?
How do you debug php?
What are the rules to declare a php variables?
Is php still in demand?
Explain what does the expression exception::__tostring means?
So if md5() generates the most secure hash, why would you ever use the less secure crc32() and sha1()?
Is false empty php?
what is difference between edit and update?
How to remove white spaces from the beginning and/or the end of a string in php?
Do you know how to get the ip address of the client?
How do we get the current session id?