RE: [PHP] Variables not set
| From: | Steve Bradwell | Date: | Fri, 26 Apr 2002 19:14:59 +0000 |
| Subject: | RE: [PHP] Variables not set | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-94789@lists.php.net to get a copy of this message | ||
Ha, Sorry wrong instance here, ya global or pass the vars to the function.
-----Original Message-----
From: Steve Bradwell [mailto:SteveB@compxnet.com]
Sent: Friday, April 26, 2002 3:13 PM
To: 'Liam Gibbs'; php-general@lists.php.net
Subject: RE: [PHP] Variables not set
I'm pretty new to php but I think your this() function you need to say:
$h = $$this;
$i = $$that;
which means the value of the var.
Sorry if I'm wrong.
-Steve
-----Original Message-----
From: Liam Gibbs [mailto:liamgibbs@yahoo.com]
Sent: Friday, April 26, 2002 3:13 PM
To: php-general@lists.php.net
Subject: [PHP] Variables not set
I have a problem with my variables not being set. I
have a file I use for constants and functions,
structured like so:
$this = "this";
$that = "that";
.
.
.
function this() {
$h = $this;
$i = $that;
}
function that() {
}
Now, when I run this(), $this isn't set (even though
it's above it in the same file). I can pretty much
guess (when running a function, it won't parse through
the whole file, just skips to that function), but I
was wondering if there is another solution. I'd hate
to separate the variable settings and the functions,
but will if I have to.
__________________________________________________
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php