subtracting time in php
<p>My aim is to set a print out data based on a time range in php.
example.. i want a user to only see current content within current time.</p>

<pre><code>&lt;?php
$set =  strtotime("2012-02-01");
$t=time();

$a= date('D F d Y', strtotime("2012-02-01"));//set current date
$b= date("D F d Y", strtotime('8 day', $set));
$c= date("D F d Y", strtotime('16 day', $set));
$d= date("D F d Y", strtotime('24 day', $set));
print '&lt;br&gt;'.$a; print '&lt;br&gt;'.$b; print '&lt;br&gt;'.$c; print '&lt;br&gt;'.$d; 

if($t &gt;= $a){ print '&lt;br&gt;1'; }
elseif(($t &gt;= $b&amp;&amp; $t&lt;$c)){ print '&lt;br&gt;2'; }
elseif(($t &lt;= $c&amp;&amp; $t&lt;$d)){ print '&lt;br&gt;3'; }
else { print '&lt;br&gt;default'; }

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

<p>it only prints out 1. </p>
