12
As Col. Shrapnel mentioned; there's quite a few ways
$path = '/some/where/img.gif';
$path = explode('.',$path);
$path = end($path);
Basic string functions, strrpos() and substr() can do that for you. As well as many other fancy ways.