title: php strtotime() function returns blank/0
body: <p>I have datetime data in string format like this:</p>
  
  <pre><code>Sat Mar 24 23:59:59 GMT 2012
  </code></pre>
  
  <p>I want to convert this into a UTC timestamp, but when I try it as follows:</p>
  
  <pre><code>function texttotime($texttime)
  {
      if(!$texttime || $texttime=="")
          return NULL;
  
      // Sat Mar 24 23:59:59 GMT 2012
      $bits = preg_split('/\s/', $texttime);
  
      //                  Mar     24      2012    23:59:59    GMT
      return strtotime("$bits[1] $bits[2] $bits[5] $bits[3] bits[4]");
  }
  </code></pre>
  
  <p>It outputs 0 (not NULL).</p>
  
  <p>If I change the last line to:</p>
  
  <pre><code>    //                  Mar     24      2012    23:59:59
      return strtotime("$bits[1] $bits[2] $bits[5] $bits[3]");
  </code></pre>
  
  <p>It outputs something (but the wrong timestamp, off by -4 hours or so).</p>