greater or = to a post value
<p>Hi all i have a post value which i am checking to see if its been posted it has atleast 4 numbers (digits) this works perfect.</p>

<pre><code>if (isset($_POST['year']) &amp;&amp; 
      !preg_match('/([0-9]{4})/i', stripslashes(trim($_POST['year']))) ) {
</code></pre>

<p>now i want to check that the value is greater or = to a vairable and not sure how to achive what i need</p>

<p>i tried the below with no luck</p>

<pre><code>$yearOff = date("Y")-150;
echo $yearOff;


    if (isset($_POST['year']) &amp;&amp; 
            !preg_match('/([0-9]{4})/i', stripslashes(trim($_POST['year']))) 
            &amp;&amp; $_POST['year'] &gt; $yearOff ) {

                   $ageerrors[] = '&lt;span class="error"&gt;
                                      You forgot enter your birth YEAR&lt;/span&gt;';
    }
</code></pre>
