For me
echo "$test ------ $foo";
results in
avalue ------
Neil
At 02:56 PM 27/08/2004, Curt Zirzow wrote:
* Thus wrote Neil: > > > Not sure if its me or the configuration of PHP
variable variables are rather standard and dont have any configuration settings.
> > I have played around with this bit of code from operators part of the > manual and this does not appear to work, well for me at least. > > $foo = "test"; > $$bar = "this is"; > > echo "${$bar} $foo"; // prints "this is test"
Everything is working so far as expected
> Note: it is the same as > echo "$test $foo"; // ***** for me it only prints out "test"
You are throwing me here.. the problem seems to be that $test hasn't been assign. By using your examples I can make $test actually be a value by doing this with the variable variable:
$$foo = 'avalue'; // $test is assinge 'avalue'
Is equivalent as doing:
$test = 'avalue'; // $test is assinge 'avalue'
And thus, without the actual $test assignment:
echo "$test $foo";
will result in:
"avalue test"
HTH,
Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid!
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Regards
Chester Cairns -------------------------------------------------------------
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php