取得路径中的目录名。
语法: string dirname(string path);
传回值: 字串
函式种类: 档案存取
本函式传回 path 中的目录名称。在 Win32 系统中,用斜线 (/) 或者反斜线 (\) 都可以;但是其它的作业系统的路径都是 (/)。
本例传回字串 $file 为 "/etc"。<?$path = "/etc/hostname";$file = dirname($path);?>
basename()