Re: loosing var in class / function
| From: | John Nichel | Date: | Wed, 04 Feb 2004 17:58:20 +0000 |
| Subject: | Re: loosing var in class / function | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-176824@lists.php.net to get a copy of this message | ||
Harry.de wrote:
How can i save a variable in a function?
The lower example doesn't work.
The var is always an empty string!
Anyone any solution?
---------------------------------------------------
$some_var = "foobar";
require('something.php');
class SOMECLASS
{
function SomeFunction()
{
$this->AnotherFunction($some_var);
}
}
----------------------------------------------------
Thanx
H.
http://us2.php.net/manual/en/language.variables.scope.php
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com