Get The Number of Sepecific String Inside String
<p>if I have a string something like this:</p>

<blockquote>
<pre><code>$string = '01122028K,02122028M,03122028K,04122028M,05122028K,06122028P-2,07122028K,08122028P-';
</code></pre>
</blockquote>

<p>How can I do to get the number of 'K' inside string <strong>$string.</strong> In this case K would be 4.
I know it can be solved by the help strpos() through out the looping after explode the $string into array. Is any php function to do it in straightforward  way?</p>

<p>Thank you.</p>
