2

Получить расширение файла

<?php
$ext = pathinfo($filename, PATHINFO_EXTENSION);