/ LJCPHPCodeDoc / LJCCommonLib / LJC / GetFileName


Parameters
$fileSpec - The file specification.

Returns

The file name.

Syntax

PHP
public static function GetFileName(string $fileSpec): string

Gets the FileName from the file spec.

Remarks

Parses from the last "/" to the following ".".

Includes to the end of the string if the "." is not found.

Example

PHP
 // Gets the FileName from the file spec.
 private static function GetFileName()
 {
   $fileSpec = "../Folder/File.txt";
   $result = LJC::GetFileName($fileSpec);
 
   // result:
   // File;
 }

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.