fork(7) download
  1. <?php
  2.  
  3. $keywords = array(
  4. "l\w*ion",
  5. "test",
  6. 'one',
  7. 'two',
  8. 'three'
  9. );
  10. $list= "/\b(?:" . implode($keywords,"|") . ")\b/i";
  11. $my_string= "This is my testing";
  12. if (preg_match($list, $my_string, $matches, PREG_OFFSET_CAPTURE)) {
  13. echo $matches[0][1];
  14. }
Success #stdin #stdout 0.02s 23692KB
stdin
Standard input is empty
stdout
Standard output is empty