title: How do I to properly handle spaces in PHP Shell_exec?
body: <p>I'm running on win2003 server, PHP 526, via the cmd-line.</p>
  
  <p>I have a cmdline string:</p>
  
  <pre><code>$cmd = '  "d:\Prog Files\foo.exe" -p "d:\data path\datadir"  ';  
  </code></pre>
  
  <p>Trying to do this in php code</p>
  
  <pre><code>$out = `$cmd`;       # note use of backticks AKA shell_exec
  </code></pre>
  
  <p>results in a failure by foo.exe as it interprets the -p arg as "d:\data".</p>
  
  <p>However, the same <code>$cdm</code> string copied to the windows shell cmdline executes successfully.</p>
  
  <p>How do I properly handle spaces in PHP <code>shell_exec</code>?</p>