"$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 constructor in a class, how it is work, how it is call?
What are the string functions in php?
What is the difference between the include() and require() functions?
how can I use bread crumb in PHP ?
I am working in VFP with no knowledge of web programming.I want to learn web database programmin. Can I choose PHP and MYSQL for that?
what is the post and get method??
How do I expire a php session after 30 minutes?
how we can crop an image and how we can display it..
Hi all,, im completely new to PHP, started learning just 2 days before. Can anybody tell me how to run a PHP file to see the program's output? i have created some simple program in Dreamweaver CS3 but don't know how to run it...
explain the changes in php version
How to set a value in session? How to remove data from a session?
can anyone explain oops concept in php or give website to learn this concept clearly?