I have a folder structure as follows:
mydomain.com ->Folder-A ->Folder-B
I have a string from Database that is \'../Folder-B/imag
Try this
dirname(dirname( __ FILE__))
Edit: removed "./" because it isn't correct syntax. Without it, it works perfectly.