There is a file in which we know the path to the root of the server;
/var/www/papka/index.php There are files that only know the relative paths to the file (above).
../../path/files/1.jpg img/files/1.jpg ../new/2.png The essence of the question is what - you need to know the full path from the index.php file, find out the full paths to the server root, for files in which we know only relative paths, and the location of the files may vary.
That is, the output should be something like this:
/var/www/over/list/path/files/1.jpg /var/www/papka/img/files/1.jpg /var/www/list/new/2.png To anyone who advises a beautiful and versatile solution, I will appreciate the crane!
realpath()satisfied? - PinkTux