PHP/File Directory/basename
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"
?>