31.12.2015, 12:23
The fastest way to do this, is:
Speed Results against your function:
Greekz
PHP Code:
stock static countStrings(const string[], const needle[])
{
new c;
for(new i=strfind(string,needle,true); i!=-1; i=strfind(string,needle,true,i+1)) c++;
return c;
}
Code:
Your time with 100.000x: 3818ms My time with 100.000x: 1466ms