Codice PHP:
$nome 'immagine.jpg';

echo 
'tipo immagine = 'array_pop(explode('.',$nome));