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

后端 未结 9 2054
暗喜
暗喜 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:27

    dirname(__DIR__,level);
    dirname(__DIR__,1);
    

    level is how many times will you go back to the folder

提交回复
热议问题