submitted by: Guest

PHP: return directory component

Find the directory componenet of a filename using the PHP function dirname().


code snippet:
<?php
$path 
"/etc/passwd";
$file dirname($path);
// $file is set to "/etc"
?>