title: PHP Comparing an array element to a string to determine results
body: <p>I have the following array:</p>
  
  <pre><code>$Output = Array
      (
          [0] =&gt; 2013-08-28 13:04:50-05:00
          [1] =&gt; 2013-08-28 18:31:29-05:00
          [2] =&gt; 2013-08-30 15:08:23-05:00
          [3] =&gt; 2013-08-30 21:45:48-05:00
          [4] =&gt; 2013-08-31 16:57:50-05:00
      )
  </code></pre>
  
  <p>Now i need to convert each element to a string so I can compare it with these variables:</p>
  
  <pre><code>$hr24 = strtotime(date('Y-m-d H:i:sP',strtotime("-1 days")));
  $hr72 = strtotime(date('Y-m-d H:i:sP',strtotime("-3 days")));
  </code></pre>
  
  <p>So what I want to do is, if the array element is over 24hr, write it to a TXT file, and if is over 72hr write to a different one. So i have this:</p>
  
  <pre><code>$OutputStr = serialize($Output);
  $OutputStr = strtotime($OutputStr);
  
  if ($OutputStr &gt; $hr24) {
  file_put_contents('/folder/test/test24hr_log.txt', print_r($OutputStr, true));
                      }
      elseif ($OutputStr &gt; $hr72) {
          file_put_contents('/folder/test/test72hr_log.txt', print_r($OutputStr, true));
              }
  </code></pre>
  
  <p>But is not giving me any answer, does anybody have an idea? I dont know if im doing the right comparison for each element. Any help is appreciated thanks!</p>