Is there any standard function in PHP to find only extension of an image from the corresponding file path?
For example ff my image path is like \'/testdir/dir2/image
It's usually more desirable to detect the actual image type (not by extension but by its contents). For that, use getimagesize().