I would prefer the
preg_match, because regexes are generally more expensive to execute.
According to the official php docs for
Do not use
preg_match()if you only
want to check if one string is
contained in another string. Use
strstr()instead as they
will be faster.