fork(3) download
  1. <?php
  2.  
  3. if (preg_match_all('~\b(?!(?:word1|word2)\b)\w+~u', "Extract all words but word1 and word2.", $matches)) {
  4. print_r($matches[0]);
  5. }
Success #stdin #stdout 0.01s 24748KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Extract
    [1] => all
    [2] => words
    [3] => but
    [4] => and
)