getting project path in php

When including php files, if the files are nested inside on and another file, certainly include path problems will occur. In order to come up with path problems we will use $_SERVER[‘DOCUMENT_ROOT’] and this path is included in any of the files according to Image,CSS,JavaScript files, and this will work throughout our project

Example

<!DOCTYPE HTML>
<html>
    <head>
        <title>application project root</title>
    </head>
<body>
	<?php
	$path = $_SERVER['DOCUMENT_ROOT'];
	echo "Server root directory : " . $path . "<br>";
	echo "Your project directory : " . $path . "practice/";
?>
</body>
</html>

Output

Server root directory : C:/wamp/www/
Your project directory : C:/wamp/www/practice/