title: PHP - how to best determine if the current invocation is from CLI or web server?
body: <p>I need to determine whether the current invocation of PHP is from the command line (CLI) or from the web server (in my case, Apache with mod_php).</p>
  
  <p>Any recommended methods?</p>