fork(1) download
  1. <?php
  2. $str = "dateto:'2015-10-07 15:05' xxxx datefrom:'2015-10-09 15:05' yyyy asdf";
  3. $matches = preg_split('/(?<!\d)(\s)/', $str);
  4. print_r($matches);
Success #stdin #stdout 0.02s 52480KB
stdin
Standard input is empty
stdout
Array
(
    [0] => dateto:'2015-10-07 15:05'
    [1] => xxxx
    [2] => datefrom:'2015-10-09 15:05'
    [3] => yyyy
    [4] => asdf
)