title: $_SERVER['SERVER_SOFTWARE'] doesn't work on command line
body: <p>I try to run a PHP script from command line to check if a specific webserver is running, but it doesn't work. </p>
  
  <p>This one works:</p>
  
  <p>
  
  <pre><code>$to = 'mail@address.com';
  $subject = 'LSWS Check';
  $message = 'Apache is Running';
  $headers = 'From: root' . "\r\n" . 'Reply-To: mail@address.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
  
  $serverSoftware = $_SERVER['SERVER_SOFTWARE'];
  $isWebserver = 'Apache';
  
  mail($to, $subject, $message, $headers);
  </code></pre>
  
  <p>This one doesn't work:</p>
  
  <p>
  
  <pre><code>$to = 'mail@address.com';
  $subject = 'LSWS Check';
  $message = 'Apache is Running';
  $headers = 'From: root' . "\r\n" . 'Reply-To: mail@address.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
  
  $serverSoftware = $_SERVER['SERVER_SOFTWARE'];
  $isWebserver = 'Apache';
  
  if (strpos($_SERVER[$serverSoftware], $isWebserver) !== false) {
    mail($to, $subject, $message, $headers);
  }
  </code></pre>
  
  <p>strpos($_SERVER[$serverSoftware] doesn't work, but why?</p>