Using PHP, getting the file extension (i.e. the ".jpg" part of the file name) of a file pretty easy:
$ext = substr(strrchr($filename, '.'), 1);
This is useful for instances where you need to create an image tag in your HTML and you don't know what the file extension is going to be, or if different file type require different attributes etc.