title: Executing and get pid a background process in PHP on Windows
body: <p>I started a process in background in Windows apache server.</p>
  
  <p>index.php following this:</p>
  
  <pre><code>&lt;?php
  $cmd = "C:/xampp/php/php.exe -f test.php";
  pclose(popen("start /B ". $cmd, "r"));
  echo "OK";
  ?&gt;
  </code></pre>
  
  <p>test.php following this:</p>
  
  <pre><code>&lt;?php
  sleep(5);
  file_put_contents("1.txt", date("Y-m-d H:i:s"));
  ?&gt;
  </code></pre>
  
  <p>At that time, I want to get pid which <code>php -f test.php</code>.
  When I start index.php, I can see new <code>php.exe</code> process in output of <code>tasklist</code> command line.
  How can I get pid for this background process.</p>
  
  <p>Thanks.</p>