title: PHP - fastest way to find if directory has children?
body: <p>I'm building a file browser, and I need to know if a directory has children (but not how many or what type).</p>
  
  <p>What's the most efficient way to find if a directory has children? <code>glob()</code>? <code>scandir()</code> it? Check its tax records?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>It seems I was misunderstood, although I thought I was pretty clear.  I'll try to restate my question.</p>
  
  <p>What is the <em>most efficient</em> way to know if a directory is not empty?  I'm basically looking for a boolean answer - NOT EMPTY or EMPTY.  </p>
  
  <p>I <em>don't</em> need to know:</p>
  
  <ul>
  <li>how many files are in the directory</li>
  <li>what the files are</li>
  <li>when they were modified</li>
  <li>etc.</li>
  </ul>
  
  <p>I <em>do</em> need to know:</p>
  
  <ul>
  <li>does the directory have any files in it at all</li>
  </ul>
  
  <p>efficiently.</p>