RE:Dynamic Arrays?

From: Date: Thu, 15 Mar 2001 16:37:28 +0000
Subject: RE:Dynamic Arrays?
Groups: php.general 
Request: Send a blank email to php-general+get-44058@lists.php.net to get a copy of this message
One problem is that you call counter "counter" in one location and call it "counter1" in another location, otherwise, I don't think many things happen successfully inside of square brackets. This problem, and general readability can be enhanced by putting spaces around '=' in your code. So,try this, it works for me: $counter = 1; $tmp="var".$counter; $arrayname[$tmp] = blah; >I have tried things like... > >$counter=1; > >$arrayname[["var".$counter1]]; >$arrayname["var$counter1"]; > >...and variations thereof. Everything I have tried has failed. > >PLEASE can someone help??

« previous php.general (#44058) next »