php how to go one level up on dirname(__FILE__)

后端 未结 9 2056
暗喜
暗喜 2020-11-30 21:52

I have a folder structure as follows:

mydomain.com
  ->Folder-A
  ->Folder-B

I have a string from Database that is \'../Folder-B/imag

9条回答
  •  庸人自扰
    2020-11-30 22:31

    Try this

    dirname(dirname( __ FILE__))
    

    Edit: removed "./" because it isn't correct syntax. Without it, it works perfectly.

提交回复
热议问题