I think you're missing the point of variable variables.

<?
$a = 'foo';
$$a = 'bar';

echo "$a $$a";
?>

After the first use of $$a, you now have a variable called $foo with a
value of 'bar'.

So your echo would be echo "$a $foo";

I kind of consider variable variables the poor mans array. Most any
solution you think of with variable variables could be better solved by
using arrays.

---John Holmes...

> -----Original Message-----
> From: Peter [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 12, 2002 10: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



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to