preg_match not working in php when count result return
<p>I have a sample text:</p>

<pre><code>$text = "ác, def ác ghi ác xyz ác, jkl";
$search = "ác";
$_x_word = '/(\s)'.$search.'(\s)/i';
preg_match($_x_word, $text, $match_words);
echo count($match_words);
</code></pre>

<p>When i echo count($match_words) is result return is null</p>

<p>How to fix it output is 2</p>
