fork download
  1. <?php
  2.  
  3. $text = "ác, def ác ghi ác xyz ác, jkl";
  4. $search = "ác";
  5. $_x_word = '/(\s)'.$search.'(\s)/i';
  6. preg_match($_x_word, $text, $match_words);
  7. echo count($match_words);
Success #stdin #stdout 0.02s 13112KB
stdin
Standard input is empty
stdout
3