$fileName = 'folder/example.file.jpg';
$extension = pathinfo($filePath, PATHINFO_EXTENSION);
//result: jpg
deneyebilir misiniz