Extracts the directory name from a file path.
dirname() is similar to basename(), but returns the directory instead.
<?php
$filename = "/var/tmp/phptest.log";
print dirname($filename);
?> /var/tmp Prints the directory part of a file path.