I would think that strpos()
would be faster because it only returns an integer (or false
if no match was found). strstr()
returns a string which contains all text after and including the first match.
For case insensitive searches, I would think that these would be slightly slower because they have to perform extra checks ("do the two chars match? if no, is the char a letter? if yes, does it match the lowercase version? if no, does it match the upper case version?", etc)