title: PHP serial com port sent and receive data
body: <p>I am working to connect a Serial COM port to send and receive data through PHP.
  And I don't have device so i have created a <a href="https://stackoverflow.com/questions/1605721/faking-an-rs232-serial-port" title="Virtual Port">Virtual com port</a> to test data.</p>
  
  <p>I can see my code is sending data as i can see the sent bytes on VSPD interface.
  But problem is that i can't receive data for testing purpose i want to read as well.</p>
  
  <p>Is there any good Virtual com port emulator or any other suggestion ?</p>
  
  <pre><code>exec("mode COM3 BAUD=9600 PARITY=N data=8 stop=1 xon=off");
  $fp = fopen("com3", "w");
  if (!$fp) {
      echo "Not open";
  } else {
      sleep(10);
      echo "Open";
      fwrite($fp, "jhh0");
      $buff = fread($fp, 10);
      echo "&gt;&gt; ".$buff." &lt;&lt;";
      //fclose($fp);
  }
  </code></pre>