PHP/File Directory/Path
pathinfo: Returns information about a file path
<?php
$pathinfo = pathinfo("./text.txt");
echo "Dir name: $pathinfo[dirname]<br />\n";
echo "Base name: $pathinfo[basename] <br />\n";
echo "Extension: $pathinfo[extension] <br />\n";
?>