PHP/File Directory/basename
basename.php
<source lang="html4strict">
<?php
$path = "/home/www/data/users.txt"; $filename = basename($path); print $filename;
?>
</source>
Getting path components
<source lang="html4strict">
<?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" ?>
</source>