How can I know if a PHP script was called from the web or from the command line? I'm guessing I should be looking at $_ENV but really don't know exactly what I'm looking for.
Thanks! 🙂
Think I found my own answer. 🙂 If $SERVER['argc'] == 0 or empty($SERVER['argv']) the script was called from the web, right? If someone can just verify this for me. 🙂
Thanks!
maybe you could use the referrer command? If there's no referrer, the user did not follow a link.
But if server works for you, why not 🙂