NYCPHP Meetup

NYPHP.org

[nycphp-talk] $$ question

Michael Southwell michael.southwell at nyphp.org
Wed May 25 16:23:57 EDT 2005


I have a question about interpreting $$variable.

I have this:
$concerts2006 = array(
array("January 28","Cypress Club - West Palm Beach, FL"),
);

and then I have this:
function showSchedule( $year ) {
....
$list = 'concerts' . $year; // this gets 'concerts2006' ok when called with 
2006
$num = count( {$$list} ); // but this does not get count( $concerts2006 )
....
<?php echo $$list[$i][0]; ?></td> // so of course this doesn't work

So the problem is at $$list.  It doesn't seem to matter whether I have
{$$list} or just $$list.

I also seem to remember from somewhere that the $$list[][] never works but
I couldn't find it in the docs.

Help??  Thanks.


Michael Southwell, Vice President for Education
New York PHP
http://nyphp.org/twoday - In-depth PHP Training Courses




More information about the talk mailing list