Extract variable out of a Class -> Function
| From: | Rahul S. Johari | Date: | Thu, 23 Apr 2009 17:55:31 +0000 |
| Subject: | Extract variable out of a Class -> Function | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-291887@lists.php.net to get a copy of this message | ||
I have a function within a class. There is a variable inside that function which I need to access & use outside of the class/function.
For example ...
Class Test {
function showOutput {
if ($this->url) {
$justTT = substr($this->url,-10,7);
echo $justTT;
}
}
}
I need to use $justTT. How do I get the value of $justTT into a different variable outside of this class/function so I can use it in a different class?
---
Rahul S. Johari
Supervisor, Internet & Administration
Informed Sources, Inc.
[Email] rahul@troyjobs.com
[Web] https://www.informed-sources.com
[Phone] 518-687-6700 Ext: 154
[Fax] 518-687-6799
---
Rahul Sitaram Johari
Founder, Internet Architects Group, Inc.
[Email] sleepwalker@rahulsjohari.com
[Web] http://www.rahulsjohari.com