title: How to get first letter of every word using regex in PHP
body: <p>I have a string variable and I want to get the first letter of every word of it.
  I want the end result to be an array of first letters.</p>
  
  <pre><code>$language = 'Sample Language';
  preg_match('/(\b[a-z])+/i', $language, $match);
  print_r($match);
  </code></pre>
  
  <p>What I am getting is only the first letter of the first word.
  The above prints Array([0]=>S [1]=>S)</p>
  
  <p>If I change it to</p>
  
  <pre><code>preg_match('/(\bL)+/i', $language, $match);
  </code></pre>
  
  <p>I can get a match for the L of the second word. So obviously after the first match it stops looking for the rest. I am not very good with regular expressions. Can anyone point out what I have done wrong?</p>
  
  <p>words in input string are not always separated by space. It is quite unpredictable. Some formats I have come across:
  "MainLanguage: Language"
  "MainLanguage, Language"
  "MainLanguage: Language-SubLanguage" here I want to get M, L and S</p>