title: how to display middle name as middle initial if middle name have two words
body: <p>so i created a form which have middle name field and display the middle name as initial. </p>
  
  <p><code>preg_split("/[\s,_-]+/",$data["s_mname"])</code></p>
  
  <p>this code works IF the middle name is only one word.. like Snow it will display as S but my problem is if the middle name is 2 words like <code>De Leon</code>, <code>Delos Santos</code> the initial that will be displayed is DL,DS.. but it should display as D... any idea how to do this..</p>
  
  <p><code>SUBSTR($data["s_mname"],strrchr($data["s_mname"], ' '), 1)</code></p>
  
  <p>i tried this code but nothing works i just got this from other site..</p>