"$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 is a simple php method to make a cross domain data request?
What is $_ get and $_ post in php?
What are properties in php?
Explain php split() function.
What is the basic function to search files for lines (or other units of text) that contain a pattern.
Do I need apache for php?
How do I check if a given variable is empty?
What is cookies php?
What is the difference between Session and Cookie?
What is difference between $x and $$x
5 Answers Mindex, Net Solution, Procon IT Solutions, Trigent,
What does php mean?
How to differentiate isset and empty
6 Answers A1 Technology, Dass Infotech, Microface,