Why is my data doubling up?
<p>For some reason when I display results from my booking engine, it displays the results as follows:  </p>

<p>Main Room<br>
Main Room 2<br>
Main Room<br>
Main Room 2<br>
Spare Room<br>
Spare Room 2<br>
Spare Room<br>
Spare Room 2  </p>

<p>It should be displaying as:  </p>

<p>Main Room<br>
Main Room 2<br>
Spare Room<br>
Spare Room 2 </p>

<p>Hoping someone can see why it is doubling up from this. </p>

<pre><code>&lt;?php 

$array_rooms =null;

    if (get_user_meta(get_current_user_id(),'admin',true)) {
        $admin = true;
    } else {
        $admin = false;
        }

    ?&gt;

&lt;head&gt;
    &lt;/head&gt;

    &lt;body id="results"&gt;

        &lt;h1&gt;Available &lt;em&gt;Rooms&lt;/em&gt;&lt;/h1&gt;
      &lt;table&gt;

          &lt;?php
          if($array_rooms != null){
              foreach($array_rooms as $key=&gt;$room) { 


              $special = '';
              $roomRatePlanID = 119;
              if($key==0){ 
                    $room['desc'] = "Main Room"; 
                    $special = '&amp;whp=1';
                    $roomRatePlanID = 68;
              }
              if($key==1){ 
                    $room['desc'] = "Main Room 2"; 
                    $special = '&amp;whp=1';
                    $roomRatePlanID = 68;
              }
              if($key==2){ 
                    $room['desc'] = "Spare Room"; 
                    $special = '&amp;whp=1';
                    $roomRatePlanID = 68;
              }
              if($key==3){ 
                    $room['desc'] = "Spare Room 2"; 
                    $special = '&amp;whp=1';
                    $roomRatePlanID = 68;
              }
?&gt;
          &lt;tr&lt;?php if (!get_user_meta(get_current_user_id(),'admin',true) &amp;&amp; strpos($room['desc'],'Main Room') !== false) echo ' class="disabled"'; ?&gt;&gt;
              &lt;td&gt;
                  &lt;div&gt;
                      &lt;h2&gt;&lt;a href="/rooms/" target="_blank"&gt;&lt;?php echo $room['desc'] ." " . $room['available'] ;?&gt;&lt;/a&gt;&lt;/h2&gt;
                      &lt;div&gt;&lt;?php
                        if ($room['desc'] == "Main Room"){
                            echo "&lt;strong&gt;Rate: $89.00&lt;/strong&gt;';
                        }elseif(($room['desc'] == "Main Room 2")){
                            echo "&lt;strong&gt;$79.00&lt;/strong&gt;";
                        } else{
                            if ($admin)
                                $netrate = number_format($room['rates'][119],2);
                            else
                                $netrate = number_format($room['rates'][20] - ($room['rates'][20] / 100 * get_user_meta(get_current_user_id(),'package',true)),2);

                            echo "Customer Rate: &lt;strong&gt;$".number_format($room['rates'][20],2).'&lt;/strong&gt; / Net Rate: &lt;strong&gt;$'.$netrate.'&lt;/strong&gt;';
                        }?&gt;&lt;/div&gt;
                      &lt;div&gt;&lt;a href="/book/summary?roomTypeCode=&lt;?php echo $room['roomTypeCode'] . $special;?&gt;"&gt;Book&lt;/a&gt;&lt;/div&gt;
                      &lt;/div&gt;
              &lt;/td&gt;
          &lt;/tr&gt;

    &lt;tr&lt;?php if (!get_user_meta(get_current_user_id(),'admin',true) &amp;&amp; strpos($room['desc'],'Main Room') !== false) echo ' class="disabled"'; ?&gt;&gt;
                  &lt;td&gt;
                      &lt;div&gt;
                          &lt;h2&gt;&lt;a href="/rooms/" target="_blank"&gt;&lt;?php echo $room['desc'] ." " . $room['available'] ;?&gt;&lt;/a&gt;&lt;/h2&gt;
                          &lt;div&gt;&lt;?php
                            if ($room['desc'] == "Spare Room"){
                                echo "&lt;strong&gt;Rate: $59.00&lt;/strong&gt;';
                            }elseif(($room['desc'] == "Spare Room 2")){
                                echo "&lt;strong&gt;$49.00&lt;/strong&gt;";
                            } else{
                                if ($admin)
                                    $netrate = number_format($room['rates'][119],2);
                                else
                                    $netrate = number_format($room['rates'][21] - ($room['rates'][21] / 100 * get_user_meta(get_current_user_id(),'package',true)),2);

                                echo "Customer Rate: &lt;strong&gt;$".number_format($room['rates'][20],2).'&lt;/strong&gt; / Net Rate: &lt;strong&gt;$'.$netrate.'&lt;/strong&gt;';
                            }?&gt;&lt;/div&gt;
                          &lt;div&gt;&lt;a href="/book/summary?roomTypeCode=&lt;?php echo $room['roomTypeCode'] . $special;?&gt;"&gt;Book&lt;/a&gt;&lt;/div&gt;
                          &lt;/div&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
          &lt;?php } }else{ echo 'no results'; }?&gt;


    &lt;/body&gt;

&lt;/html&gt;
</code></pre>
