fork download
  1. <?php
  2.  
  3. $str =" ... {{word1}} {{word2}} .... etc";
  4. preg_match_all("/\{\{(\w+)\}\}/", $str, $matches);
  5. print_r($matches[1]);
  6.  
  7. ?>
Success #stdin #stdout 0.02s 13112KB
stdin
Standard input is empty
stdout
Array
(
    [0] => word1
    [1] => word2
)