xxreenaxx1 Posted March 7, 2011 Share Posted March 7, 2011 Why wont my radio array show the value that was selected. If a user select a radio then the value should be printed. But it should print the question id then the choice that was chosen for that question id. <?php $gender = $_POST["choice"]; $que_ID = $_POST["Que_ID"]; foreach ($gender as $key => $value) { echo $key." - ".$value."";} ?> $intNum = 1; $intnumber = 1; while( $info = mysql_fetch_array( $sqll )){ echo "<input type='hidden' name=\"Que_ID\" value=\"{$info['Que_ID']}\" /> "; echo " $intNum, {$info['Que_Question']} <br />\n"; $intNum++; for ($i =1; $i < 5; $i++) { echo "<input type=\"Radio\" name=\"choice[{$info['Que_ID']}][]\" />{$info['Que_Choice'.$i]}<br />\n"; $intnumber++; Link to comment https://forums.phpfreaks.com/topic/229868-radio-array-trouble/ Share on other sites More sharing options...
AbraCadaver Posted March 7, 2011 Share Posted March 7, 2011 Try: foreach ($gender as $key => $array) { foreach($array as $value) { echo $key." - ".$value; } } Link to comment https://forums.phpfreaks.com/topic/229868-radio-array-trouble/#findComment-1184098 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.