I tried things like $_ENV[\'CLIENTNAME\'] == \'Console\' but that seems to work on only certain OS\'s (worked in windows, not linux).
I tried !empty($_ENV[\'SHELL\']) b
if ($argc > 0) { // Command line was used } else { // Browser was used }
$argc coounts the amount of arguments passed to the command line. Simply using php page.php, $argc will return 1
Calling page.php with a browser, $argc will return NULL