Back to PhocaDownloadFile class

Method getTitleFromFilenameWithoutExt

public static
getTitleFromFilenameWithoutExt
(mixed &$filename)

Method getTitleFromFilenameWithoutExt - Source code

public static function getTitleFromFilenameWithoutExt(&$filename)
{
    $folder_array = explode('/', $filename);
    //Explode the filename (folder and file name)
    $count_array = count($folder_array);
    //Count this array
    $last_array_value = $count_array - 1;
    //The last array value is (Count array - 1)
    $string = false;
    $string = preg_match("/\\./i", $folder_array[$last_array_value]);
    if ($string) {
        return PhocaDownloadFile::removeExtension($folder_array[$last_array_value]);
    } else {
        return $folder_array[$last_array_value];
    }
}