title: Replace isset for each $_POST using foreach
body: <p>I've been trying to replace each isset for $_POST(s) using foreach.</p>
  
  <p>This is the real code using isset for each $_POST :</p>
  
  <pre><code>&lt;form method='post'&gt;
  
      &lt;input type='text' name='name'&gt; &lt;br&gt;
      &lt;input type='text' name='address'&gt; &lt;br&gt;
      &lt;input type='submit' name='send'&gt; 
  
  &lt;/form&gt;
  
  &lt;?php
  
  if (isset($_POST['name']) &amp;&amp; isset($_POST['address']) &amp;&amp; isset($_POST['send']))
  {
     echo "All elements have been submitted";
  }
     else
  {
     echo "You forget some elements, try checking name or address";
  }
  
  ?&gt;
  </code></pre>
  
  <p>is there a way I can replace 4 isset(s) above with single isset using for each?
  I've made this and it goes wrong.</p>
  
  <pre><code>&lt;form method='post'&gt;
  
      &lt;input type='text' name='nama'&gt; &lt;br&gt;
      &lt;input type='text' name='alamat'&gt; &lt;br&gt;
      &lt;input type='submit' name='kirim'&gt; 
  
  &lt;/form&gt;
  
  &lt;?php
  
  foreach($_POST as $value)
  {
      if (isset($value))
      {
        echo "All elements have been submitted";
      }
      else
      {
        echo "You forget some elements, try checking name or address";
      }
  }
  ?&gt;
  </code></pre>
  
  <p>Need help guys, It's just wasting of time if I have to write isset one by one for each element I send via post / get. I've seen something like this before in visual basic, my friend made an foreach construct to validate all textboxes in a form, so he didn't need to create something like this anymore :</p>
  
  <pre><code>if textbox1.text="" &amp;&amp; textbox.2.text="" and so on
  </code></pre>