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

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

    You could use PHP's dirname function. . That will give you the name of the parent directory of __DIR__, which stores the current directory.

提交回复
热议问题