basename(string $path, string $extension)
なし
変数名 | 変数型 | 説明 |
---|---|---|
$path | string | 除去するパス文字列です。 |
$suffix | string | 除去する接頭辞です。 |
string $path = "/usr/people/gamera/gamera.mel"; string $basename = basename( $path, ".mel" ); // Result: gamera // basename( $path, "" ); // Result: gamera.mel // string $ntPath = "C:/aw/godzilla/hello.c"; basename( $ntPath, ".c" ); // Result: hello //