public function File::getExtension

Returns the extension of the file.

\SplFileInfo::getExtension() is not available before PHP 5.3.6

@api

Return value

string The extension

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/File.php, line 91

Class

File
A file in the file system.

Namespace

Symfony\Component\HttpFoundation\File

Code

public function getExtension() {
  return pathinfo($this
    ->getBasename(), PATHINFO_EXTENSION);
}