NYCPHP Meetup

NYPHP.org

[nycphp-talk] PHP Dynamic GET Variables , Do they exist?

Chris Snyder chsnyder at gmail.com
Fri Apr 30 19:39:31 EDT 2010


On Fri, Apr 30, 2010 at 7:24 PM, CED <consult at covenantedesign.com> wrote:
> <?php
> //GIVEN a page that is called with:
> //    $_GET['abc'] = 'def';
> //CODED with:
>   $dynamic_vars['a']['b'] = 'abc';
>
>   // NO WORKY
>   echo $_GET[ $dynamic_vars['a']['b'] ] ;
>
>   // NO WORKY
>
>   if(isset($_GET[ $dynamic_vars['a']['b'] ])){
>      echo $_GET[ $dynamic_vars['a']['b'] ] ;
>   }
> ?>
>
> What am I doing wrong?
> (this is obviously for demonstration purposes only, the actually variables
> have need for being stored in the manner that they are)
>
> -Ed

Sample code works for me, php 5.3.2.



More information about the talk mailing list