Alternative to realpath($_SERVER["DOCUMENT_ROOT"])

Hey, my variable $root = realpath($_SERVER[“DOCUMENT_ROOT”]) doesn’t consistently work, sometimes it’s just blank, anyone know why this wouldn’t be working and if there is an alternative for variable to use for finding your website directory name? Thanks!

Sponsor our Newsletter | Privacy Policy | Terms of Service