title: How do I check if a directory exists? "is_dir", "file_exists" or both?
body: <p>I want to create a directory if it does not exist already.</p>
  <p>Is using the <code>is_dir</code> function enough for that purpose?</p>
  <pre><code>if ( !is_dir( $dir ) ) {
      mkdir( $dir );       
  }
  </code></pre>
  <p>Or should I combine <code>is_dir</code> with <code>file_exists</code>?</p>
  <pre><code>if ( !file_exists( $dir ) &amp;&amp; !is_dir( $dir ) ) {
      mkdir( $dir );       
  } 
  </code></pre>