fork download
  1. <?php
  2. $example = "DELIM1test1DELIM2test2DELIM1test3DELIM2test4"; // and so on
  3. $keywords = preg_split("/DELIM1|DELIM2/", $example,0,PREG_SPLIT_NO_EMPTY);
  4. print_r($keywords);
Success #stdin #stdout 0.02s 52432KB
stdin
Standard input is empty
stdout
Array
(
    [0] => test1
    [1] => test2
    [2] => test3
    [3] => test4
)