Page 1 of 1

Variable variables again!

Posted: Fri Apr 30, 2010 1:32 pm
by spacebiscuit
I began programming in PHP 12 years ago and I just cannot get my head around variable variables:

Does anyone know why this is causing an error:

Code: Select all

echo"$_GET[toedit{"${z}"}]";
The variable names are toedit1, toedit2 etc!

Thanks,

Rob.

Re: Variable variables again!

Posted: Fri Apr 30, 2010 2:19 pm
by mikosiko

Code: Select all

echo"$_GET[toedit{"${z}"}]";
looks like incorrect " usage to me

Re: Variable variables again!

Posted: Fri Apr 30, 2010 2:22 pm
by Eran
This is not variable variable, it's a simple string.

Code: Select all

echo $_GET['toedit' . $z];