"$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 can I do by cakePHP?
Explain the difference between require() and require_once()?
What does empty mean in php?
What does $globals mean?
Explain what does $_server means?
How many types of arrays are there in php?
What are php data types?
What is isset function in php?
What is the difference between for and foreach?
How to convert a string to lowercase in php?
Which array function checks if the particular key exists in the array?
What is a query in a database?