Get parent directory of running script

后端 未结 13 2003
攒了一身酷
攒了一身酷 2020-11-30 04:20

In PHP, what would be the cleanest way to get the parent directory of the current running script relative to the www root? Assume I have:

$_         


        
相关标签:
13条回答
  • 2020-11-30 05:15

    Try this. Works on both windows or linux server..

    str_replace('\\','/',dirname(dirname(__FILE__)))

    0 讨论(0)
提交回复
热议问题