Preventing form empty submit
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/10950470/check-if-multiple-strings-are-empty">Check if multiple strings are empty</a>  </p>
</blockquote>



<p>today i got this answer <a href="http://stackoverflow.com/questions/10950470/chek-if-multiple-strings-are-empty/10950581#10950581">here</a> on stackoverflow:</p>

<pre><code>&lt;input type="text" name="required[first_name]" /&gt;
&lt;input type="text" name="required[last_name]" /&gt;
...

$required = $_POST['required'];
foreach ($required as $req) {
     $req = trim($req);
     if (empty($req))
     echo 'gotcha!';
 }
</code></pre>

<p>This is ok, but what if someone change </p>

<pre><code> name="required[first_name]"
</code></pre>

<p>To</p>

<pre><code>  name=""
</code></pre>

<p>Then i will have some data missing in further code (i use form to send submited data to email). How to fix this?</p>
