fork(1) download
  1. <?php
  2.  
  3. $input = array("⋃","⋃","a","⋃","h");
  4. $impl = implode($input);
  5. $impl = preg_replace('/⋃{2}/u','$0|',$impl);
  6. preg_match_all('~\X~u', $impl, $tokens);
  7. print_r($tokens);
Success #stdin #stdout 0.01s 52488KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Array
        (
            [0] => ⋃
            [1] => ⋃
            [2] => |
            [3] => a
            [4] => ⋃
            [5] => h
        )

)