RE: [PHP] Varible Varibles
| From: | Peter | Date: | Thu, 13 Jun 2002 03:11:22 +0000 |
| Subject: | RE: [PHP] Varible Varibles | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-101865@lists.php.net to get a copy of this message | ||
Ok,...
what sort situations would you benifit using the first method?
ie
is it more suiteable to making some conditions
eg
$a = foo;
while {$$a <= bar)
echo "$a";
endwhile;
-----Original Message-----
From: Martin Towell [mailto:martin.towell@world.net]
Sent: Thursday, 13 June 2002 12:44 PM
To: 'Peter'; Php
Subject: RE: [PHP] Varible Varibles
well, the first method is the same as saying
$a = "foo";
$foo = "bar";
echo "$a $foo";
whereas the second method is appending "bar" to $a (thus making it "foobar")
In first method, you get two variables, the second, just one
-----Original Message-----
From: Peter [mailto:php@vfsa.com.au]
Sent: Thursday, June 13, 2002 12:42 PM
To: Php
Subject: [PHP] Varible Varibles
howdy,
I'm just curious here about varible varibles ... I know that you can, well
it's documented that you can, do the following
<?
$a = foo;
$$a = bar;
echo "$a $$a";
?>
which will produce foo bar
now what I am curious about is, how much of a difference does that really
make when you compare it to..
<?
$a = foo;
$a .= bar;
echo "$a";
?>
Cheers
Peter
"the only dumb question is the one that wasn't asked"
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php