"$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 difference between put and post method in http?
How many columns can be added in a table in mysql?
How do you use bcrypt for hashing passwords in php?
Explain the importance of the function htmlentities.
What is php resource type?
Is php closing tag necessary?
how to use between operator when retrieve from database(format-2008-jun-06)
Which is incorrect with respect to separating php code and html?
What are the different types of array in php?
What is the difference between array_map () and array_shift ()?
How to get a random value from a php array?
What are new features in php 7?