title: How to check array empty or not in php
body: <p>I am having huge array. Its structure is like this:</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [id] =&gt; 57060
              [customer] =&gt; 1         
              [desc] =&gt; Customer Object
                  (
                      [id] =&gt; 51716
                      [name] =&gt; abc xyz           
                      [supplier] =&gt; stdClass Object
                          (
                              [@size] =&gt; 1
                              [Supplier] =&gt; stdClass Object
                                  (
                                      [@chainCode] =&gt; EP
                                      [@id] =&gt; 13
                                  )
                          )
  
                      [Types] =&gt; stdClass Object
                          (
                              [@size] =&gt; 9
                              [Type] =&gt; Array
                                  (
                                      [0] =&gt; stdClass Object
                                          (
                                              [@Code] =&gt; 394431
                                              [@TypeId] =&gt; 497374                                
                                                  (
                                                      [@size] =&gt; 27
                                                      [Amenity] =&gt; Array
                                                          (
                                                              [0] =&gt; stdClass Object
                                                                  (
                                                                      [@amenityId] =&gt; 8149624
                                                                      [amenity] =&gt; Air Conditioning
                                                                  )
  
                                                              [1] =&gt; stdClass Object
                                                                  (
                                                                      [@amenityId] =&gt; 8149701
                                                                      [amenity] =&gt; 
                                                                  )
                                                            )
                                                            .....
                                                            ..... and so on
  </code></pre>
  
  <p>I trying to check simply if the above array is empty or not. </p>
  
  <pre><code>&lt;table&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;b&gt;View my Reviews&lt;/b&gt;&lt;/td&gt;
      &lt;/tr&gt;
  
      &lt;tr&gt;
          &lt;td colspan=10&gt;
              &lt;div&gt;&lt;/div&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  
      &lt;?php
      if (!empty($this-&gt;revArr)) {
          foreach ($this-&gt;revArr as $review):
              ?&gt;
              &lt;tr&gt;
                  &lt;td class="col1"&gt;
                      &lt;?php echo ($review['name'] == '') ? 'a guest' : $review['name']; ?&gt; &lt;br/&gt;on &lt;span style="font-size:11px;"&gt;&lt;?php echo date("M j, Y", strtotime($review['created_at'])); ?&gt;&lt;/span&gt;
  
                  &lt;/td&gt;
                  &lt;td class="col2"&gt;                   
                      &lt;span class="name"&gt;&lt;a href="/hotelreview/&lt;?php echo $review['hotelId']; ?&gt;"&gt;&lt;?php echo $review['Info']-&gt;Name; ?&gt;&lt;/a&gt;&lt;/span&gt;
                      &lt;br/&gt;
                      &lt;span class="address"&gt;&lt;?php
                  echo $review['Info']-&gt;address1;
                  if ($review['Info']-&gt;address2 != '') {
                      echo ' ' . $review['Info']-&gt;address2;
                  }
                  if ($review['Info']-&gt;address3 != '') {
                      echo ' ' . $review['hotelInfo']-&gt;address3;
                  }
                  ?&gt;&lt;/span&gt;
  
                      &lt;div style="margin-top:10px;"&gt;
                          &lt;h4&gt;&lt;b&gt;&lt;?php echo ($review['title'] == '') ? 'A Review By' : $review['title']; ?&gt;&lt;/b&gt;&lt;/h4&gt;
                          &lt;p&gt;&lt;?php
                  $detail = str_replace("\r", "\n", $review['detail']);
                  $detail = preg_replace("#\n+#", "\n", $detail);
                  echo str_replace("\n", "&lt;/p&gt;&lt;p&gt;", $detail);
                          ?&gt;&lt;/p&gt;
                      &lt;/div&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
  
          &lt;?php endforeach; ?&gt;  
          &lt;tr&gt;
              &lt;td colspan=10 style="text-align:right;"&gt;
                  &lt;?php echo $pagination; ?&gt;                
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;?php } {
          ?&gt;
          &lt;tr style="text-align: center;"&gt;
              &lt;td&gt;No Review Found !!&lt;/td&gt;
          &lt;/tr&gt;
      &lt;?php }
      ?&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Where I am going wrong? Why above all conditions are not working? </p>
  
  <p>Need Help. </p>
  
  <p>Thanks.</p>