title: Does PHP have a function to detect the OS it's running on?
body: <p>I wouldn't know under what keyword to look for this in the PHP database, so I'm asking here.</p>
  
  <p>Reason I want to know is because of how different Operating Systems handle new lines in textdocuments.</p>
  
  <p>I'm using a CSV file in windows but each time I think I add a new line, what really happens is the new line gets pasted to the back of the latest line.</p>
  
  <p>Reason is, in windows, a new line is this: <code>\r\n</code>
  And the CSVHandler.class.php file I'm using only adds <code>\n</code></p>
  
  <p>However, in MAC OS X that's the new line, which is different from windows.</p>
  
  <p>So I'm looking for this so I can implement a simple <code>if()</code> statement and solve this. Currently I've hardcoded the <code>\r\n</code>, but it should be simpler, no?</p>