/ LJCPHPCodeDoc / LJCCommonLib / LJCCommon / 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. (E)

Remarks

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

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

Example

PHP
 $webCommonPath = "c:/inetpub/wwwroot/LJCPHPCommon";
 require_once "$webCommonPath/LJCCommonLib.php";
 
 // $text = "File"
 $text = LJCCommon::GetFileName("../Folder/File.txt");

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