<?php
$server = $_SERVER["SERVER_NAME"];
$pathpath = realpath("../../files/uploaded_file.jpg");
echo "You can link to the file using the following link... $server$pathpath";
?>
残念ながら、これにより次の結果が生成されます...
www.example.com/home/fhlinux123/g/example.com/user/htdocs/ninja/base/files/1.doc
私が求めているのは次のとおりですが...
www.example.com/files/uploaded_file.jpg
「ファイル」フォルダーが常に同じディレクトリにあるとは限りません。