"$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 |
What are the uses of explode() function?
What are the different types of Errors in PHP?
20 Answers Cisco, TCS, Troop Software,
Is php an api?
How can we take a backup of a mysql table and how can we restore it. ?
7 Answers Brain Infosys, Oracle,
What are the differences between php3 and php4 and php5? What is the current stable version of php? What advance thing in php7?
What is the difference between javascript and php?
How can we access the data sent through the url with the post method?
what is hidden variable? what is its difference with the normal variable...
Explain the types of functions for Splitting String?
Which is incorrect with respect to separating php code and html?
What is the functionality of the function strstr and stristr?
What are the two main string operators?