You are here

protected function File::getName in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/File/File.php \Symfony\Component\HttpFoundation\File\File::getName()

Returns locale independent base name of the given path.

Parameters

string $name The new file name:

Return value

string containing

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 128

Class

File
A file in the file system.

Namespace

Symfony\Component\HttpFoundation\File

Code

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