title: How to Check if Multi-Dimensional Associative Array is Empty
body: <p>I have an array as follows:</p>
  
  <pre><code>$list_array = array();
  
  $list_array[] = array (
                   'id' =&gt; 1,
                   'name' =&gt; 'Sean',
                   'codename' =&gt; 'Maverick'
                   );
  
  $list_array[] = array (
                   'id' =&gt; 2,
                   'name' =&gt; 'Matt',
                   'codename' =&gt; 'Diesel'
                   );
  
  $list_array[] = array (
                   'id' =&gt; 3,
                   'name' =&gt; 'Bonnie',
                   'codename' =&gt; 'Princess'
                   );
  </code></pre>
  
  <p>I am trying to figure out how I can check to see if it's empty.  I look on the site and tried a couple of things, but it's not working.  Here are the things I've tried.</p>
  
  <pre><code>Attempt 1:
  if (empty($list_array)
      echo "Array is empty";
  
  
  Attempt 2:
  $arr_empty = true;
  $arr_length = count($list_array);
  echo "Length: " . $arr_length . "&lt;br&gt;";
  for ($z=1; $z&lt;=$arr_length; $z++)
  {
      $arr_length2 = count($list_array[$z]);
      echo $z . " Length2: " . $arr_length2 . "&lt;br&gt;";
      if (empty($list_array[$z]))
          echo $z . " Is Empty&lt;br&gt;";
  }
  </code></pre>
  
  <p>I feel like I'm missing the obivious here.</p>