title: Change date format when echo in php
body: <p>This is my code it works perfectly except I want the date on the buttons to be formatted as Thursday 15th, not 2019-08-15.
  The dates are pulled from the MySQLI database where the date formate is 2019-08-15. I cannot change the select date format as I need the date format in the button value to match the format in the database. So I only want to change the format on the button.</p>
  <p><a href="https://gohs.no/mb/index.php" rel="nofollow noreferrer">Here is a working example</a></p>
  <p>I really appreciate all your help!!</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php
  include 'DBController.php';
  $db_handle = new DBController();
  $countryResult = $db_handle-&gt;runQuery("SELECT DISTINCT date FROM okm_concerts_2019 ORDER BY date ASC");
  ?&gt;
  
  &lt;html&gt;
  &lt;head&gt;
  &lt;link href="style.css" type="text/css" rel="stylesheet" /&gt;
  &lt;/head&gt;
  &lt;body&gt;
         &lt;div id="demo-grid"&gt;
    &lt;form method="post" action="index.php"&gt;
   
                  &lt;?php
                          if (! empty($countryResult)) {
                              foreach ($countryResult as $key =&gt; $value) 
                              {
                                  echo '&lt;button name="country[]" value=' . $countryResult[$key]['date'] .'"&gt;' . $countryResult[$key]['date'] . '&lt;/button&gt;';
                              }
                          }
                          ?&gt;
                  
      
                  &lt;?php
                  if (! empty($_POST['country'])) {
                      ?&gt;
                      &lt;table cellpadding="10" cellspacing="1"&gt;
  
                  &lt;thead&gt;
                      &lt;tr&gt;
                          
                          &lt;th&gt;&lt;strong&gt;Konsert&lt;/strong&gt;&lt;/th&gt;
                          &lt;th&gt;&lt;strong&gt;Start&lt;/strong&gt;&lt;/th&gt;
                          &lt;th&gt;&lt;strong&gt;Venue&lt;/strong&gt;&lt;/th&gt;
                      &lt;/tr&gt;
                  &lt;/thead&gt;
                  &lt;tbody&gt;
                  &lt;?php
                      $query = "SELECT * FROM okm_concerts_2019
                      JOIN okm_locations ON okm_concerts_2019.location_id = okm_locations.id"
                      ;
                      $i = 0;
                      $selectedOptionCount = count($_POST['country']);
                      $selectedOption = "";
                      while ($i &lt; $selectedOptionCount) {
                          $selectedOption = $selectedOption . "'" . $_POST['country'][$i] . "'";
                          if ($i &lt; $selectedOptionCount - 1) {
                              $selectedOption = $selectedOption . ", ";
                          }
                          
                          $i ++;
                      }
                      $query = $query . " WHERE date in (" . $selectedOption . ") ORDER BY time_start ASC";
                      
                      $result = $db_handle-&gt;runQuery($query);
                   
                       
                  }
                  if (! empty($result)) {
                      foreach ($result as $key =&gt; $value) {
                          ?&gt;
                  
      
      
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>