Which one is a more reliable matching scheme, EREGI or STRIPOS?
-
21-08-2019 - |
Question
Which scheme according to you is a better one in case of matching?
Is it eregi or stripos or any other method?
Solution
That depends if you want to do exact match or regexp match.
- stripos is for case insensitive matching of string in another string
- eregi is case insensitive regexp matching in a string
- fnmatch is the third alternative. It's simple wildcard matching as in globbing.
Moreover, eregi is deprecated, is not binary safe and does not work well with UTF-8.
For regexp matching you should use preg_match with i
flag instead.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow