title: How to get PID from PHP function exec() in Windows?
body: <p>I have always used:</p>
  
  <pre><code>$pid = exec("/usr/local/bin/php file.php $args &gt; /dev/null &amp; echo \$!");
  </code></pre>
  
  <p>But I am using an XP virtual machine to develop a web app and I have no idea how to get the pid in windows.</p>
  
  <p>I tried this on a cmd:</p>
  
  <pre><code>C:\\wamp\\bin\\php\\php5.2.9-2\\php.exe "file.php args" &gt; NUL &amp; echo $!
  </code></pre>
  
  <p>And it gets the file executed, but the output is "$!"</p>
  
  <p>How can I get the pid into the var $pid? (using php)</p>