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