fork download
  1. <?php
  2.  
  3. $msg="Dear [[5]] We wish to continue the lesson with the [[6]]";
  4.  
  5. preg_match_all("/\[\[(\d+)\]\]/", $msg, $matches);
  6. print_r($matches[1]);
  7. ?>
Success #stdin #stdout 0.02s 13064KB
stdin
Standard input is empty
stdout
Array
(
    [0] => 5
    [1] => 6
)