getFilenameWithoutExtension() публичный статический Метод

Returns the file name without the extension from a file path.
С версии: 1.1 Added method.
С версии: 2.0 Method now fails if $path or $extension have invalid types.
public static getFilenameWithoutExtension ( string $path, string | null $extension = null ) : string
$path string The path string.
$extension string | null If specified, only that extension is cut off (may contain leading dot).
Результат string The file name without extension.
Пример #1
0
 /**
  * @expectedException \InvalidArgumentException
  * @expectedExceptionMessage The extension must be a string or null. Got: array
  */
 public function testGetFilenameWithoutExtensionFailsIfInvalidExtension()
 {
     Path::getFilenameWithoutExtension('/style.css', array());
 }