title: How to count non-empty entries in a PHP array?
body: <p>Consider:</p>
  
  <pre><code>[name] =&gt; Array ( [1] =&gt; name#1
                    [2] =&gt; name#2
                    [3] =&gt; name#3
                    [4] =&gt; name#4
                    [5] =&gt;
                    [6] =&gt;
                    [7] =&gt;
                    [8] =&gt;
                    [9] =&gt;
                  )
  
  
  $name = $_POST['name']
  </code></pre>
  
  <p>I want the result to be <code>4</code>.</p>
  
  <pre><code>count ($name) = 9
  count (isset($name)) = 1
  count (!empty($name)) = 1
  </code></pre>
  
  <p>I would think that last one would accomplish what I need, but it is not (the empty entries are from unfilled inputs on the form).</p>