3
我有一个长路径的文件,例如,如何在没有文件基名的情况下返回文件的路径?
http://www.mysite.com/local/views/templates/home.php
我用basename()
返回文件只本身,
<?php echo basename($file);?>
但我怎么可以返回该文件的路径不包含文件的basename就像下面这行一样?
http://www.mysite.com/local/views/templates/
感谢Jon的回答!我将手动添加斜杠:-) – laukok 2012-01-17 15:29:35