<?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"; ?>