API16

JFile/getName

< API16:JFile

The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description

Returns the name, sans any path


<! removed transcluded page call, red link never existed >

Syntax

getName($file)
Parameter Name Default Value Description
$file

Returns

string filename

Defined in

libraries/joomla/filesystem/file.php

Importing

jimport( 'joomla.filesystem.file' );

Source Body

function getName($file) {
        $slash = strrpos($file, DS);
        if ($slash !== false) {
                return substr($file, $slash + 1);
        } else {
                return $file;
        }
}


<! removed transcluded page call, red link never existed >

Examples

Code Examples


Advertisement