title: Split string on non-alphanumerics in PHP? Is it possible with php's native function?
body: <p>I was trying to split a string on non-alphanumeric characters or simple put I want to split words. The approach that immediately came to my mind is to use regular expressions.  </p>
  
  <p><strong>Example:</strong><br>
  <code>$string = 'php_php-php php';<br>
  $splitArr = preg_split('/[^a-z0-9]/i', $string);</code></p>
  
  <p>But there are two problems that I see with this approach.  </p>
  
  <ol>
  <li>It is not a native php function, and is totally dependent on the PCRE Library running on server.</li>
  <li>An equally important problem is that what if I have punctuation in a word<br>
  <strong>Example:</strong><br>
  <code>$string = 'U.S.A-men's-vote';<br>
  $splitArr = preg_split('/[^a-z0-9]/i', $string);</code><br>
  Now this will spilt the string as <code>[{U}{S}{A}{men}{s}{vote}]</code><br>
  But I want it as <code>[{U.S.A}{men's}{vote}]</code></li>
  </ol>
  
  <p>So my question is that:</p>
  
  <ul>
  <li>How can we split them according to words?</li>
  <li>Is there a possibility to do it with php native function or in some other way where we are not dependent?</li>
  </ul>
  
  <p>Regards</p>