Forum Moderators: coopster
I would like to change some of these to strpos but I'm at a loss how I'm supposed to enforce matches at start and end of string (the ^ and $), I don't want strpos to match something in the middle of a string.
ex:
preg_match('/^widget 2\.0/i', $string)
This string must *start* with this pattern to be able to evaluate it as true(in switch statements).
vs
strpos($string, 'widget 2.0')
which would match(or rather not return false) even if the string was "blue widget 2.0"
I guess the short of it is I'm wondering if there's a way to match the meaning of ^ or $ with strpos.