title: Find if an array is empty in PHP
body: <p>I have an array in PHP, which I have to check if it is empty. </p>
  
  <pre><code>    $length = count($array_new);
      if(empty($array_new)) 
          echo("Array is empty");
      else
          echo("Array is not empty");
      echo("\n");
      print_r($array_new);
      echo("Length of array is".$length);
  </code></pre>
  
  <p><strong>The output is-</strong> </p>
  
  <pre><code>Array is not empty
  Array
  (
      [0] =&gt;
      [1] =&gt;
      [2] =&gt;
      [3] =&gt;
  )
  Length of array is 4
  </code></pre>
  
  <p>I know that the array is empty, then why does it show that the length of the array is 4? Can anyone tell me what is wrong here?</p>