0
有沒有辦法達到以下目的?包含的PHP腳本的腳本路徑?
在我/www/var/public_html/index.php文件我有這個
<?php include('database/connect.php'); ?>
然後在/www/var/public_html/database/connect.php,我想要做這樣的事情
<?php
$my_path = get_path_of_current_script(); // should not be path of index.php
echo $my_path;
// should print
// /www/var/public_html/database
?>
我不想$ my_path的打印/ WWW的/ var /的public_html/
是否有一個PHP函數來做到這一點?