fork download
  1. <?php
  2.  
  3. $str = "hyper text-markup_language";
  4. $res = preg_split('~[\s_-]+~', $str, 0, PREG_SPLIT_NO_EMPTY);
  5. print_r($res);
Success #stdin #stdout 0s 82944KB
stdin
Standard input is empty
stdout
Array
(
    [0] => hyper
    [1] => text
    [2] => markup
    [3] => language
)