Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. File.php

function File::getName

Same name in this branch
  1. 11.1.x vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/File.php \PhpParser\Node\Scalar\MagicConst\File::getName()

Returns locale independent base name of the given path.

2 calls to File::getName()
File::getTargetFile in vendor/symfony/http-foundation/File/File.php
UploadedFile::__construct in vendor/symfony/http-foundation/File/UploadedFile.php
Accepts the information of the uploaded file as provided by the PHP global $_FILES.

File

vendor/symfony/http-foundation/File/File.php, line 133

Class

File
A file in the file system.

Namespace

Symfony\Component\HttpFoundation\File

Code

protected function getName(string $name) : string {
    $originalName = str_replace('\\', '/', $name);
    $pos = strrpos($originalName, '/');
    return false === $pos ? $originalName : substr($originalName, $pos + 1);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal