interface to USB receipt printer in a point of sale system using php
<p>good afternoon all,</p>

<p>i am currently writing a system in PHP that requires interface with a USB thermal receipt printer for a friend upon form submission. currently i have read about interfacing with devices containing a parallel port but there has not been much detail on how i can use PHP to interface with a USB thermal receipt printer. hence any advice on the topic would be appreciated.</p>

<p>so far i have designed the receipt consisting of data that has been posted from the form. the next step would be to reproduce it on the thermal printer.</p>

<p>thank you for your time and interest.</p>

<p>God bless</p>

<hr>

<pre><code>&lt;?php
$handle = fopen("PRN", "w"); // note 1 
fwrite($handle, 'text to printer'); // note 2 
fclose($handle); // note 3 
?&gt;
</code></pre>

<blockquote>
  <p>1) Establish the connection with the
  receipt printer through PRN.</p>
  
  <p>2) Writes to the receipt printer
  through the file handle.</p>
  
  <p>3) Disconnect the printer.</p>
</blockquote>

<p>this is what i found on @ <a href="http://www.kksou.com/php-gtk2/Recipes/0399.php" rel="nofollow">http://www.kksou.com/php-gtk2/Recipes/0399.php</a></p>

<p>it is rather vague? any idea as to how it works?</p>
