次のことを達成する方法はありますか?
私の/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関数はありますか?