title: How to check if a multidimensional array is empty or not?
body: <p>Basically, I have a multidimensional array, and I need to check whether or not it is simply empty, or not.</p>
  
  <p>I currently have an <code>if</code> statement trying to do this with:</p>
  
  <pre><code>if(!empty($csv_array)) 
  {   
      //My code goes here if the array is not empty
  }
  </code></pre>
  
  <p>Although, that <code>if statement</code> is being activated whether the multidimensional array is empty or not.</p>
  
  <p>This is what the array looks like when empty:</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
          )
  
  )
  </code></pre>
  
  <p>This is what the array looks like when it has a few elements in it:</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
          )
  
      [1] =&gt; Array
          (
              [1] =&gt; question1
              [2] =&gt; answer1
              [3] =&gt; answer2
              [4] =&gt; answer3
              [5] =&gt; answer4
          )
  
      [2] =&gt; Array
          (
              [1] =&gt; question2
              [2] =&gt; answer1
              [3] =&gt; answer2
              [4] =&gt; answer3
              [5] =&gt; answer4
          )
  
      [3] =&gt; Array
          (
              [1] =&gt; question3
              [2] =&gt; answer1
              [3] =&gt; answer2
              [4] =&gt; answer3
              [5] =&gt; answer4
          )
  
  )
  </code></pre>
  
  <p>My array elements always start at 1, and not 0. Long story why, and no point explaining since it is off-topic to this question.</p>
  
  <p>If needed, this is the code that is creating the array. It is being pulled from an uploaded CSV file.</p>
  
  <pre><code>$csv_array = array(array());
  if (!empty($_FILES['upload_csv']['tmp_name'])) 
  {
      $file = fopen($_FILES['upload_csv']['tmp_name'], 'r');
  }
  
  if($file)
  {
      while (($line = fgetcsv($file)) !== FALSE) 
      {
          $csv_array[] = array_combine(range(1, count($line)), array_values($line));
      }
  
      fclose($file);
  }
  </code></pre>
  
  <p>So in conclusion, I need to modify my <code>if statement</code> to check whether the array is empty or not.</p>
  
  <p>Thanks in advance!</p>