要獲取當前執行的腳本路徑,可以使用`$_SERVER['SCRIPT_FILENAME']`或`$_SERVER['PHP_SELF']`來獲取當前執行的腳本路徑。
例如:
```php
$current_script_path = $_SERVER['SCRIPT_FILENAME'];
echo "當前執行的腳本路徑是:".$current_script_path;
```
或者:
```php
$current_script_path = $_SERVER['PHP_SELF'];
echo "當前執行的腳本路徑是:".$current_script_path;
```