file_check_path
includes/file.inc, строка 138
- Версии
- 5 – 6
file_check_path(&$path)
Checks path to see if it is a directory, or a dir/file.
Параметры
$path
A string containing a file path. This will be set to the
directory's path.
Возвращаемое значение
If the directory is not in a Drupal writable directory, FALSE
is
returned. Otherwise, the base name of the path is returned.
Связанные темы
Код
<?php
function file_check_path(&$path) {
// Check if path is a directory.
if (file_check_directory($path)) {
return '';
}
// Check if path is a possible dir/file.
$filename = basename($path);
$path = dirname($path);
if (file_check_directory($path)) {
return $filename;
}
return FALSE;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии