title: php get `date("Ymd")-1`
body: <p>I store some <code>error_log</code> with date for their name. like <code>20120827.txt</code></p>
  
  <p>Now I write some php script for view the <code>error_log</code>.</p>
  
  <p>I need do some judgment:</p>
  
  <pre><code>if(file_exists(date("Ymd").'.txt')){ 
     $html = file_get_contents(date("Ymd").'.txt');
  }else{
     $html = file_get_contents((date("Ymd")-1).'.txt');//load yesterday's `error_log`.
  }
  </code></pre>
  
  <p>But this not suit the date like <code>20120801.txt</code>, How to do <code>date("Ymd")-1</code>? </p>
  
  <p>I tried <code>date("Ymd", (strtotime($date) . " -1 day"));// return:19700101</code> </p>