On 10/11/07, Anders Norrbring <lists@xxxxxxxxxxxx> wrote: > > Is there a good way to detect in a script if it's called locally from > command line, or via a remote browser? > > Anders maybe not the best, but works for linux: <?php if(isset($_SERVER['SHELL'])) { echo 'cli script' . PHP_EOL; } else { echo 'web script'; } ?> -nathan