Home  >  Article  >  Backend Development  >  怎么取得路径返回父目录呢

怎么取得路径返回父目录呢

WBOY
WBOYOriginal
2016-06-13 10:04:271030browse

如何取得路径返回父目录呢?
admin 和 date admin目录里的某文件要require date目录里的一个文件 怎么做啊?


require (dirname(__FILE__)."../date/my_class.php")

------解决方案--------------------
弄清 admin 和 date admin目录的关系再说
------解决方案--------------------

PHP code
if (!defined('DS'))  define('DS',DIRECTORY_SEPARATOR);$arr = explode(DS,dirname(__FILE__));array_pop($arr);require_once (implode(DS,$arr).DS."date".DS."my_class.php");<div class="clear">
                 
              
              
        
            </div>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn