NYCPHP Meetup

NYPHP.org

[nycphp-talk] $$ question

Andrew Yochum andrew at digitalpulp.com
Wed May 25 16:35:25 EDT 2005


On Wed, May 25, 2005 at 04:23:57PM -0400, Michael Southwell wrote:
> 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.

How about:

	$list = 'concerts' . $year;
	$listref = &$$list;
	$num = count( $listref );
	<?php echo $listref[$i][0]; ?></td>
	...

HTH,
Andrew



More information about the talk mailing list