title: Display date format as DD MM YYYY in Codeigniter
body: <p><img src="https://i.stack.imgur.com/D5mxT.png" alt="CLICK TO SEE THE OUTPUT"></p>
  
  <p>As you can see my date.of.birth format is Y-m-d, so I hope to change my D.O.B (tarikh lahir) format to d-m-Y,please help. </p>
  
  <p>This is model ： Search_model.php</p>
  
  <pre><code>&lt;?php
  
  class Search_model extends CI_Model {
  
      public function get_results($search_term='default')
      {
          // Use the Active Record class for safer queries.
          // $this-&gt;load-&gt;helper('share_function');
          $this-&gt;db-&gt;select('pesakit.rn,pesakit.nama,pesakit.tarikhlahir,jantina.nama as jantina,agama.nama as agama,bangsa.nama as bangsa');
          $this-&gt;db-&gt;from('lifeline.pesakit as pesakit');
          $this-&gt;db-&gt;join('jantina','jantina.kod = pesakit.jantina');
           $this-&gt;db-&gt;join('agama','agama.kod = pesakit.agama');
            $this-&gt;db-&gt;join('bangsa','bangsa.kod = pesakit.bangsa');
          $this-&gt;db-&gt;where('rn',alphaToNumber($search_term));
  
  
          // Execute the query.
          $query = $this-&gt;db-&gt;get();
  
          // Return the results.
          return $query-&gt;result_array();
      }
  
  }
  </code></pre>
  
  <p><br><br>
  This is view : search_results.php</p>
  
  <pre><code>&lt;div&gt; 
  
      &lt;?php
          foreach ($results as $val)
          {
              echo 'RN : '; echo numberToAlpha( $val['rn']); echo "&lt;br/&gt;";
              echo 'Name : '; echo  $val['nama']; echo "&lt;br/&gt;";
              echo 'Date.of.Birth : '; echo $val['tarikhlahir']; echo "&lt;br/&gt;";
              echo 'Age:' ; echo calculateCurrentAge ($val['tarikhlahir']); echo "&lt;br/&gt;";
              echo 'Gender : '; echo $val['jantina']; echo "&lt;br/&gt;";
              echo 'Race : '; echo $val['bangsa']; echo "&lt;br/&gt;";
              echo 'Religion : '; echo $val['agama'];
          }
      ?&gt;
  &lt;/div&gt;
  </code></pre>