title: How to get a platform independent directory separator in PHP?
body: <p>I'm building a path string in PHP. I need it to work across platforms (i.e., Linux, Windows, OS X). 
  I'm doing this:</p>
  
  <pre><code>$path = $someDirectory.'/'.$someFile;
  </code></pre>
  
  <p>Assume <code>$someDirectory</code> and <code>$someFile</code> are formatted correctly at run-time on the various platforms. This works beautifully on Linux and OS X, but not on Windows. The issue is the <code>/</code> character, which I thought would work for Windows.</p>
  
  <p>Is there a PHP function or some other trick to switch this to <code>\</code> at runtime on Windows?</p>
  
  <p><b>EDIT:</b> Just to be clear, the resultant string is </p>
  
  <pre><code>c:\Program Files (x86)\Sitefusion\Sitefusion.org\Defaults\pref/user.preferences
  </code></pre>
  
  <p>on Windows. Obviously the mix of slashes confuses Windows.</p>