What function can I use to read what the root directory path is?
pwd perhaps? which 'root' dir do you mean? if true root it always is perceived as / if web root, that's a server var.
check your phpinfo() page to see what's available.