我有一个从 / 执行的 php cli 脚本,但该脚本位于 /opt/script/script.php 中。如何从脚本中获取脚本的动态位置
$location = ... (Get the location of the script)
echo $location == '/opt/script' ? 'YAY' : 'Stupid';
Run Code Online (Sandbox Code Playgroud)
输出
YAY
Run Code Online (Sandbox Code Playgroud)
那种事。