title: PHP script - detect whether running under linux or Windows?
body: <p>I have a PHP script that may be placed on a windows system or a linux system. I need to run different commands in either case. </p>
  
  <p>How can I detect which environment I am in? (preferably something PHP rather than clever system hacks)</p>
  
  <h2>Update</h2>
  
  <p>To clarify, the script is running from the command line.</p>