sKunKbad Posted November 16, 2007 Share Posted November 16, 2007 I need $count to be inside $_POST['Q$count'] as in the following, but its not working. ++$count; echo "For question # $count, \"<em>" .$question->q. "</em>\", your answer was {$_POST['Q$count']}.<br />"; I've tried a few different things, but can't get it done. What am I doing wrong here? Thanks. Link to comment https://forums.phpfreaks.com/topic/77593-variable-inside-variable/ Share on other sites More sharing options...
Lumio Posted November 16, 2007 Share Posted November 16, 2007 $_POST['Q'.$count] or $_POST["Q$count"] or $_POST["Q".$count] ... Link to comment https://forums.phpfreaks.com/topic/77593-variable-inside-variable/#findComment-392746 Share on other sites More sharing options...
sKunKbad Posted November 16, 2007 Author Share Posted November 16, 2007 ok I figured it out on my own: ++$count; $num = "Q$count"; $qnum = $_POST[$num]; echo "For question # $count, \"<em>" .$question->q. "</em>\", your answer was $qnum.<br />"; Link to comment https://forums.phpfreaks.com/topic/77593-variable-inside-variable/#findComment-392747 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.