PHP/File Directory/basename
Версия от 10:37, 26 мая 2010; (обсуждение)
basename.php
<?php
$path = "/home/www/data/users.txt";
$filename = basename($path);
print $filename;
?>
Getting path components
<?php
$full_name = "/usr/local/php/php.ini";
$base = basename($full_name); // $base is "php.ini"
$dir = dirname($full_name); // $dir is "/usr/local/php"
?>