title: Check if an associative array is empty
body: <p>I have an associative array of id. In the controller I want to check if the array received is empty or not. I have written the following code for it but it does not work.</p>
  
  <pre><code>$product1=$_POST['id'];
  $productString = implode(" ",$product1);
  echo $productString; 
  if(is_null($productString)){
     echo "No Values";
  }else {
      echo "Values are present";
  }
  </code></pre>
  
  <p>I have tried with empty() as well but in all the case even if there are no values in the array, which I am converting into a string, it says values are present. 
  There are 5 fixed rows in my table in the view file, so, even if the values are empty the array output shows </p>
  
  <pre><code>Array ( 
      [0] =&gt; 
      [1] =&gt; 
      [2] =&gt; 
      [3] =&gt; 
      [4] =&gt; 
  )
  </code></pre>
  
  <p>Any help is welcome.</p>