RE: [PHP] Varible Varibles

2002-06-12 Thread Martin Towell
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:[EMAIL PROTECTED]] Sent

RE: [PHP] Varible Varibles

2002-06-12 Thread Peter
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

RE: [PHP] Varible Varibles

2002-06-13 Thread John Holmes
I think you're missing the point of variable variables. 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 variable

RE: [PHP] Varible Varibles

2002-06-13 Thread Pushkar Pradhan
I'm trying to use variable variables to work on arrays: $forest = array("a", "b", "c", ...); $layer[$l]= "forest"; Now I want to access all array members of $forest using $$layer: e.g. for($c = 0; $c < $$layer[$l]; $l++) { echo $$layer[$l][$c]; } But this doesn't work, gives syntax error, So

Re: [PHP] Varible Varibles

2002-06-13 Thread Jason Wong
On Friday 14 June 2002 00:38, John Holmes wrote: > I think you're missing the point of variable variables. Quite :-) > 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. Actually variable