PHP-How to get values from multiples dynamic radio button
<p>i´m doing a little survey and i have the next problem.
I get the data from database and the name of the answer is the id of the question(question 1 id=1, question 2 id=2...)</p>

<pre><code>    &lt;div id='box'&gt;
       &lt;form action='#' method='POST'&gt;
           &lt;?php
           foreach($lista as $list){
             echo "&lt;p&gt;".$list-&gt;getQuestion()."&lt;/p&gt;";
          $idtemp=$list-&gt;getid(); //first get question
           $arr=$list-&gt;getQuestion($idtemp);
       foreach ($arr as $ar) { 
    //second, get and draw the radio with the answers per question
         echo "&lt;input type='radio' value='".$ar[0]."' name='".$idtemp."'&gt;".$ar[1]."&lt;/input&gt;&lt;br&gt;";

}

        }

           ?&gt;

    &lt;button type="button" &gt;Cancel&lt;/button&gt;

&lt;button type='submit' value='end' name='end'&gt;end&lt;/button&gt;
&lt;?php
if (isset($_POST['end'])) {
    echo "&lt;span&gt;selected :&lt;b&gt; ".$_POST['radio']."&lt;/b&gt;&lt;/span&gt;";

    }
    ?&gt;
    &lt;/form&gt;
    &lt;/div&gt; 
</code></pre>

<p>I only wants to get the radios checked and sending to database, </p>