I am using Apache server for PHP. How can I retrieve my web root in PHP, like http://localhost/testthesis/?
http://localhost/testthesis/
Here is one way of doing it:
$web_root = "http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/"; OUTPUT -->http://website.com/parent_folder/