john_zakaria Posted April 6, 2009 Share Posted April 6, 2009 hi everyone please i want to print the value of the variables $myradiobutton1 $myradiobutton2 $myradiobutton3 $myradiobutton4 ....... $myradiobutton10 i made a for loop to print the values of each $myradiobutton($i) but i can not print it ... can anyone help me the code is for($i = 1; $i < 11; $i++) { echo $myradiobutton.$i.'<Br><BR>'; } please try to fix this problem thnx in advance Quote Link to comment Share on other sites More sharing options...
Mark Baker Posted April 6, 2009 Share Posted April 6, 2009 You should really use an array for your radio buttons, it make things so much easier However for($i = 1; $i < 11; $i++) { $radioButtonName = 'myradiobutton'.$i; echo $$radioButtonName.'<br /><br />'; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.