dirname: get the directory name for a file
<?php $path = "./test.txt"; $dirname = dirname($path); echo $dirname; ?>