Calling a Variable in a weird Way

From: Date: Thu, 07 Mar 2002 05:51:35 +0000
Subject: Calling a Variable in a weird Way
Groups: php.general 
Request: Send a blank email to php-general+get-87582@lists.php.net to get a copy of this message
I am not sure I can articulate this well. But I will try. I want to combine either two variables or a variable and string to bring up the name of a previous variable name to display the data from the first. So in the first part I will have a listing that will look like <type=radio name=state_1 value=No> <type=radio name=state_1 value=Yes> <type=radio name=state_1 value=Maybe> <type=radio name=state_2 value=No> <type=radio name=state_2 value=Yes> <type=radio name=state_2 value=Maybe> // Submit etc.... Then later I will call a for loop to try and do something like for ($i=1; $i < 12; $i++) { echo state_$i; // This would print out either Yes No or Maybe. } Is there a way I can do this. I thought I heard something about how I can but I do not remember. Phillip

« previous php.general (#87582) next »