variables in variables names

From: Date: Thu, 23 Nov 2000 16:03:22 +0000
Subject: variables in variables names
Groups: php.general 
Request: Send a blank email to php-general+get-26841@lists.php.net to get a copy of this message
Hi, I need to do a thing like this: $a1 = 4; $a2 = 3; $a3 = 6; for ($i = 1; $i <= 18; $i++){ echo "a$i= " . ${a$i}; <-- parse error } I guess it worked in php3, anyway what is the right syntax to write this in both php3 and php4? thx

« previous php.general (#26841) next »