我想为文件夹设置动态路径,例如,如果用户使用ubuntu,则路径将设置为ubuntu目录(var/www/)
;如果用户使用Windows系统,则将根路径设置为窗口的文件夹,例如(xampp/htdocs/project)
答案 0 :(得分:0)
<?php
echo $_SERVER['DOCUMENT_ROOT']; // This to get root working directory
echo $abs = $_SERVER['DOCUMENT_ROOT'] . '/project_directory/';
// This is to add your current working directory folder to root directory
?>