fork download
  1. <?php
  2.  
  3. $str = '[date|Y-m-d]';
  4. preg_match_all('/[^][|]+/', $str, $matches);
  5. print_r($matches[0]);
  6.  
Success #stdin #stdout 0.02s 23600KB
stdin
Standard input is empty
stdout
Array
(
    [0] => date
    [1] => Y-m-d
)