"$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 curl php?
What is $_ server request_method == post?
What is the functionality of the function html entities?
What is difference between php and wordpress?
What is cookie in php with example?
What is session and Cokkies . How it works . tell some thing about Session_id()
What is difference between print and echo in php?
How to run a php script?
Why triggers are used in mysql?
What is the difference between InnoDb tables and MyIsam Tables in php
What is the latest version of php?
In How many ways can u represent Not equal?Give Syntax of all ways..