fork download
  1. <?php
  2. $string = "variable = some text here [[ word ]] some text here";
  3. preg_match('/\[\[(.*?)\]\]/', $string, $regs);
  4. $result = $regs[1];
  5. echo $result;
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
 word