What's the best way to achieve the following:
I have a $img variable containing e.g. myimage_left.jgp, someimage_center.jpg or img_right.jpg
What's the best way to test for _left, _right or _center of the filename and extract this value and store it in a variable?
So I have $img which already contains the complete basename of the file. And I need to have $pos which should hold _center or _left or _right.
What's the way to do that? preg_match, strpos, etc?