why "" is not empty?
<p>I am trying this code:</p>

<pre><code>&lt;?php
$form = $_POST['myformdata'];

class validacoes {

    function validate_year($form) {
        $input_datas = $form['data'];
        foreach($input_datas as $val){
            if($val&gt;1930 &amp;&amp; $val&lt;2012){
                echo "correct";
            }
            else
            echo "bad"; //show bad bad

        }
    }
}

$val = new validacoes();

$data = array();
var_dump($form['data']);


try {
    if (!empty($form['data'])){// why this is true ?
    $data['livre'] = $val-&gt;validate_year($form);
    }
    else
    echo "empty"; 
} catch (Exception $e) {
    $data['livre'] = $e-&gt;getMessage();
}

echo json_encode($data);

?&gt;
</code></pre>

<p>//var_dump</p>

<pre><code>var_dump($form['data']);

    array
      0 =&gt; string '' (length=0)
      1 =&gt; string '' (length=0)
</code></pre>

<p>Why the function <code>validate_year($form)</code> is running without any input ? should be empty, correct ?</p>
