fork download
  1. <?php
  2.  
  3. $content = preg_split('/([\p{P}\p{S}])|\s/', 'int some_number;', -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
  4. print_r($content);
Success #stdin #stdout 0.01s 82944KB
stdin
Standard input is empty
stdout
Array
(
    [0] => int
    [1] => some
    [2] => _
    [3] => number
    [4] => ;
)