Ich habe ein php cli-Skript, das von / ausgeführt wird, aber das Skript liegt in /opt/script/script.php. Wie kann ich den dynamischen Speicherort des Skripts innerhalb des Skripts ermitteln?
$location = ... (Get the location of the script)
echo $location == '/opt/script' ? 'YAY' : 'Stupid';
Ausgabe
YAY
Diese Art von Dingen.