title: Identify $_POST type in php
body: <p>Hi i have a lot of input in my form some of them are radio button and others are text and textbox. I am getting all of these values with </p>
  
  <pre><code>foreach ($_POST as $name =&gt; $val)
  {
   //for example if post type==radio
   //there is some insertion codes to db in here $name,$val...
  
  }
  </code></pre>
  
  <p>but i want use that insertion if post value is radio button. How can i do it?</p>
  
  <p>my form looks like </p>
  
  <pre><code>&lt;form method="post" action="&lt;?=$_SERVER['REQUEST_URI']?&gt;"&gt;
  .
  .
  .
  //a lot of table,tr,td,input,etc. in this part
  .
  .
  .
  
  &lt;td style="border-style:solid; border-width:2px 1px 1px 2px"&gt;&lt;input type="radio" class="metalYayaKorkuluk_Deformasyon" name="metalYayaKorkuluk_Deformasyon" style="width:100%; margin:0px; display:table-caption" value="1" /&gt;&lt;/td&gt;
  &lt;td style="border-style:solid; border-width:2px 1px 1px 1px"&gt;&lt;input type="radio" class="metalYayaKorkuluk_Deformasyon" name="metalYayaKorkuluk_Deformasyon" style="width:100%; margin:0px; display:table-caption" value="2" /&gt;&lt;/td&gt;
  &lt;td style="border-style:solid; border-width:2px 1px 1px 1px"&gt;&lt;input type="radio" class="metalYayaKorkuluk_Deformasyon" name="metalYayaKorkuluk_Deformasyon" style="width:100%; margin:0px; display:table-caption" value="3" /&gt;&lt;/td&gt;
  &lt;td style="border-style:solid; border-width:2px 2px 1px 1px"&gt;&lt;input type="radio" class="metalYayaKorkuluk_Deformasyon" name="metalYayaKorkuluk_Deformasyon" style="width:100%; margin:0px; display:table-caption" value="4" /&gt;&lt;/td&gt; 
  
  &lt;td style="border-style:solid; border-width:1px 1px 2px 2px"&gt;&lt;input type="radio" class="plastikKaplama4" name="plastikKaplama4" style="width:100%; margin:0px; display:table-caption" value="1" &lt;?php echo ($plastikKaplama4=='1')?'checked':'' ?&gt;/&gt;&lt;/td&gt;
  &lt;td style="border-style:solid; border-width:1px 1px 2px 1px"&gt;&lt;input type="radio" class="plastikKaplama4" name="plastikKaplama4" style="width:100%; margin:0px; display:table-caption" value="2" &lt;?php echo ($plastikKaplama4=='2')?'checked':'' ?&gt;/&gt;&lt;/td&gt;
  &lt;td style="border-style:solid; border-width:1px 1px 2px 1px"&gt;&lt;input type="radio" class="plastikKaplama4" name="plastikKaplama4" style="width:100%; margin:0px; display:table-caption" value="3" &lt;?php echo ($plastikKaplama4=='3')?'checked':'' ?&gt;/&gt;&lt;/td&gt;
  &lt;td style="border-style:solid; border-width:1px 2px 2px 1px"&gt;&lt;input type="radio" class="plastikKaplama4" name="plastikKaplama4" style="width:100%; margin:0px; display:table-caption" value="4" &lt;?php echo ($plastikKaplama4=='4')?'checked':'' ?&gt;/&gt;&lt;/td&gt;
  
  
  &lt;input id='elm2' type="submit" name="save2" value="Submit" /&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>to summerize im trying to get all of name and its value of selected radio button with foreach but i dont want to get other intputs such as text and textarea.</p>