title: Output of sorting results in html
body: <p>There are problems, almost 20 hours without sleep)
  Arraying the array outputs the result and everything is fine, but ...</p>
  
  <p>Here is the parsing code for the array:</p>
  
  <pre><code>$html = '';
  foreach ($nposts as $post){ 
  
  if ($post['post_date'] != $last_date)
      {
      $html .= '&lt;h3&gt;'.$post['post_date'].'&lt;/h3&gt;' ;
      } 
  
   $html .= '&lt;div&gt;id: ' . $post['ID'] . ' ' . $post['title'] . '&lt;/div&gt;&lt;br&gt;';
   $last_date = $post['post_date'];
  
  };
  echo $html;
  </code></pre>
  
  <p>As a result, I get this:</p>
  
  <pre><code>&lt;h3&gt;Wednesday 24 January 2018&lt;/h3&gt;
  &lt;div&gt;id: 1475 Title&lt;/div&gt;
  &lt;br&gt;
  &lt;div&gt;id: 1455 Title&lt;/div&gt;
  &lt;br&gt;
  
  &lt;h3&gt;Tuesday 23 January 2018&lt;/h3&gt;
  &lt;div&gt;id: 1388 Title&lt;/div&gt;
  &lt;br&gt;
  &lt;div&gt;id: 1358 Title&lt;/div&gt;
  &lt;br&gt;
  &lt;div&gt;id: 1315 Title&lt;/div&gt;
  &lt;br&gt;
  &lt;div&gt;id: 1219 Title&lt;/div&gt;
  &lt;br&gt;
  &lt;div&gt;id: 1198 Title&lt;/div&gt;
  &lt;br&gt;
  
  &lt;h3&gt;Monday 22 January 2018&lt;/h3&gt;
  &lt;div&gt;id: 1063 Title&lt;/div&gt;
  &lt;br&gt;
  &lt;div&gt;id: 996 Title&lt;/div&gt;
  &lt;br&gt;
  
  &lt;h3&gt;Wednesday 01 January 2014&lt;/h3&gt;
  &lt;div&gt;id: 959 Title&lt;/div&gt;
  &lt;br&gt;
  </code></pre>
  
  <p>A little bit is not what I'm trying to get</p>
  
  <p>I want to get this:</p>
  
  <p>Separately the date, and all that apply to this date. Date as the title.
  For example as news on sites.</p>
  
  <p>01/22/2018</p>
  
  <p>news 1
  news 2
  news 3</p>
  
  <p>23.012018</p>
  
  <p>news 1
  news 2</p>
  
  <pre><code>&lt;div class="one"&gt;   
  &lt;h3&gt;Wednesday 24 January 2018&lt;/h3&gt;
          &lt;div class="two"&gt;id: 1475 Title&lt;/div&gt;
  
          &lt;div class="two"&gt;id: 1455 Title&lt;/div&gt;
  
  &lt;/div&gt;
  
  &lt;div class="one"&gt;   
      &lt;h3&gt;Tuesday 23 January 2018&lt;/h3&gt;
          &lt;div class="two"&gt;id: 1388 Title&lt;/div&gt;
  
          &lt;div class="two"&gt;id: 1358 Title&lt;/div&gt;
  
          &lt;div class="two"&gt;id: 1315 Title&lt;/div&gt;
  
          &lt;div class="two"&gt;id: 1219 Title&lt;/div&gt;
  
          &lt;div class="two"&gt;id: 1198 Title&lt;/div&gt;&gt;
  
  &lt;/div&gt;
  
      ......
  </code></pre>
  
  <p>Help, I'm already too tired</p>