Assuming ireplace is required, the following result was found.
by Preg_Match+Count took : 0.46423101425171 Seconds Count by str_replace took : 0.23512482643127 Seconds Count By str_ireplace took : 0.39766597747803 Seconds Count By Explode+Count took : 0.25045800209045 Seconds Count By Array Functions took :...